Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.8.2 #21

Merged
merged 264 commits into from
May 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
264 commits
Select commit Hold shift + click to select a range
79ba486
build: unbreak if CFLAGS is defined in make's env
vasild Feb 19, 2020
b84b4b4
lightningd: rename htlc_in and htlc_out failuremsg fields to failonion.
rustyrussell Feb 17, 2020
ad3c7f3
lightningd: clean up weird call to send_htlc_out.
rustyrussell Feb 17, 2020
bb9b761
channeld: don't get details of our own failed htlcs at init.
rustyrussell Feb 17, 2020
c7bbdd7
lightningd: handle fail_htlc_in with no known outgoing channel.
rustyrussell Feb 17, 2020
7ab5c42
gossipd: provide (stripped) channel_update when resolving a channel.
rustyrussell Feb 17, 2020
ed839bf
channeld: get the onionreply back from lightningd for failed htlcs.
rustyrussell Feb 17, 2020
cec18df
lightningd: remove always-NULL argument to add_fail.
rustyrussell Feb 17, 2020
a150b09
wallet: Add new htlc column "localfailmsg" for outgoing htlcs.
rustyrussell Feb 18, 2020
1a3ed18
channeld: add routing to get our own channel's channel_update.
rustyrussell Feb 18, 2020
72d55d3
lightningd: store raw msg rather than code for locally-failed outgoin…
rustyrussell Feb 21, 2020
5af3a13
lightningd: separate path for failed_htlc when an onion is bad.
rustyrussell Feb 21, 2020
590b2db
lightningd: make local htlc failures pass a wiremsg for errors, not a…
rustyrussell Feb 21, 2020
bbc7a79
lightningd: always use an onionreply for locally generated incoming H…
rustyrussell Feb 21, 2020
447730e
wallet: only store BADONION codes in db for incoming htlcs: rest are …
rustyrussell Feb 21, 2020
c9e73dc
lightningd: rename htlc_in field from failcode to badonion.
rustyrussell Feb 21, 2020
faac4b2
plugins: support failure_message in invoice and htlc_accepted hooks.
rustyrussell Feb 21, 2020
6b7db1e
common: remove unused json_add_double()
vasild Feb 18, 2020
89ceb27
wire: remove towire_double()
vasild Jan 29, 2020
73ad9b5
common: avoid locale dependent strtod(3)
rustyrussell Feb 19, 2020
c49c869
wally: Specify that we use python3 so we don't depend on python2
cdecker Feb 26, 2020
87e924e
docker: Remove Dockerfile for i386 builder
cdecker Feb 26, 2020
7f6f324
python2: Remove python2 dependency from docs and dockerfiles
cdecker Feb 26, 2020
7275793
pytest: Test a plugin crash while handling a hook call
cdecker Feb 5, 2020
644daa0
plugin: Cleanup a plugin as soon as its stdout closes
cdecker Feb 14, 2020
4a21883
plugin: Fix hanging hook calls if the plugin dies
cdecker Feb 12, 2020
41a5728
plugin: Do not forward plugin hook calls during shutdown
cdecker Feb 13, 2020
0987747
plugin: Avoid calling a destructor on a request that was freed
cdecker Feb 16, 2020
23149c3
plugin: Actually wait the 20 seconds promised in the docs
cdecker Feb 18, 2020
8f87579
cleanup: Remove current_plugin from plugin_hook_request
cdecker Feb 19, 2020
684ed42
common/wireaddr: don't include lightningd/lightningd.
rustyrussell Feb 27, 2020
2aad3ff
common: tal_dup_talarr() helper.
rustyrussell Feb 27, 2020
c51c6f9
sphinx: use crypto_stream_chacha20_xor to generate stream and xor at …
rustyrussell Feb 27, 2020
247d249
gossipd: provide helper to get a channels cupdate, create routine to …
rustyrussell Feb 27, 2020
40e3566
lightningd: use the async mechanism for channel_update access.
rustyrussell Feb 27, 2020
f8a21f1
lightingd: do a local short_channel_id lookup for forwarding.
rustyrussell Feb 27, 2020
1b08074
hsmd/hsmd.c: Correct a comment.
ZmnSCPxj Feb 4, 2020
d9b2482
lightningd/hsm_control.c: Implement `getsharedsecret`.
ZmnSCPxj Feb 4, 2020
42d1d3b
wally: Bump libwally to fix gcc 4.8 support
cdecker Mar 2, 2020
d3ece69
fix: adds bcli plugin to check-source targets
m-schmoock Feb 28, 2020
6c50185
fix: cppcheck ignore two false positives on uninitvar
m-schmoock Mar 2, 2020
6f41d18
doc: add pyln-proto to PYTHONPATH for pytest in HACKING
darosior Mar 4, 2020
3572d59
tests: fix flake in libplugin test.
rustyrussell Mar 4, 2020
9529529
pytest: Repro wrong error being returned on invalid onion payloads
cdecker Mar 4, 2020
0ba6aba
onion: Do not leak parsed TLV if it is invalid
cdecker Mar 4, 2020
959687b
onion: Pass the position and type of the failing TLV type out
cdecker Mar 4, 2020
ac5cba2
htlc: Return an invalid payload error if payload is invalid
cdecker Mar 4, 2020
6e86022
build: force libwally-core to compile in C99 mode
vasild Mar 5, 2020
53ecf09
build: remove unrecognized option to libsodium
vasild Mar 3, 2020
820f1b2
build: send cmp's stderr to /dev/null also
vasild Mar 5, 2020
1fd45a0
bitcoind: timeout if the Bitcoin plugin never completes the handshake
darosior Mar 4, 2020
8e055a4
bcli: remove a superfluous variable
darosior Mar 4, 2020
53913c5
Use of null
dscotese Mar 6, 2020
524d22e
doc: update listchannels manpage
darosior Mar 7, 2020
c92e782
wire: add fromwire_tal_arrn() helper.
rustyrussell Mar 4, 2020
66eca2f
lightningd: always broadcast the latest close tx
vasild Feb 28, 2020
15ca3b6
make: Add compat flag for v0.8.1
cdecker Mar 3, 2020
d2688bb
plugin: Unwrap the rpc_command payload
cdecker Mar 3, 2020
0cf3e19
pyln-testing: save stderr logs for checking
niftynei Mar 8, 2020
34cef2c
pyln-testing: add flag 'expect_fail' to node factory get_node
niftynei Mar 8, 2020
4e30a82
plugins: pass back opts as indicated type. fixes #3577
niftynei Mar 8, 2020
d19cddf
pyln: enforce types of options
niftynei Mar 8, 2020
cac5a0c
plugins: use stricter parsing for option values
niftynei Mar 8, 2020
b25a8ba
plugins: test for option value checking and parsing
niftynei Mar 8, 2020
41b1805
plugin: add in deprecated_api behavior and test
niftynei Mar 8, 2020
8539442
bitcoin-cli reference is confusing (#3583)
arcbtc Mar 10, 2020
06e9a9f
bitcoind: check that Bitcoin plugin is alive before requesting
darosior Mar 9, 2020
bc74e49
pytest: Add tests for the sphinx onion generation and processing
cdecker Feb 28, 2020
96dc023
sphinx: Working onion wrapping with filler cancellation
cdecker Feb 20, 2020
59b6159
sphinx: Functions to enable RV mode and serialize compressed onions
cdecker Feb 28, 2020
45400cf
onion: Allow devtool/onion to generate rendezvous onions
cdecker Feb 28, 2020
4724d55
pytest: Add test for compressed onion
cdecker Feb 28, 2020
49a3321
sphinx: Add functions to decompress
cdecker Feb 28, 2020
fd37c5b
sphinx: Expose the shared secret creation function
cdecker Mar 2, 2020
e79cda8
sphinx: Treat compressed onions as a standalone struct
cdecker Mar 2, 2020
6dd14a2
sphinx: Kill read_buffer with fire 🔥
cdecker Mar 3, 2020
ef86ee0
sphinx: Migrate sphinx compression to new interface
cdecker Mar 3, 2020
3710549
sphinx: Use fromwire_tal_arrn() to deserialize compressed onions
cdecker Mar 4, 2020
2b2ee87
travis: do not cache ./external
vasild Mar 6, 2020
43a46e2
devtools/onion: allow '-' input file so you can pipe from stdin.
rustyrussell Mar 11, 2020
f541044
devtools/onion: change defile assocdata to empty.
rustyrussell Mar 11, 2020
b162a0e
tests: note the private keys of our test nodes.
rustyrussell Mar 11, 2020
24984ec
common/sphinx: add realm flag so we can avoid legacy parsing.
rustyrussell Mar 11, 2020
f2478e9
doc: point out 8char visual tabs in STYLE.md
m-schmoock Mar 5, 2020
af7e879
fix: rfc #740 requires 100% feespike margin
m-schmoock Mar 12, 2020
a08905c
plugin tests: actually check log result + move over to '' -> true
niftynei Mar 11, 2020
42cce55
plugins: add 'flag' type for plugin options
niftynei Mar 17, 2020
563b468
plugins: remove 'blank' option parsing for bool
niftynei Mar 17, 2020
751df86
gossipd: fix compilation warnings with clang 10
vasild Mar 17, 2020
24aaf73
pytest: Actually make sure that the direcory exists
cdecker Jan 26, 2020
42a63e4
tx: Strengthen transaction construction checks
cdecker Feb 8, 2020
c236bf0
tx: Make elements_add_fee_output private
cdecker Feb 8, 2020
3e3b05e
pyln: Migrate remaining uses of the deprecated pylightning module
cdecker Feb 11, 2020
cf8c972
pyln-testing: Print a list of files if we can't remove the test dir
cdecker Feb 19, 2020
7201cb7
pytest: Configure logging in a fixture to match stdout capturing
cdecker Feb 19, 2020
5532305
pytest: Unbreak the test_feerate_spam test for elementsd
cdecker Feb 27, 2020
9736c7b
pytest: Make test_pay_retry less flaky for liquid-regtest
cdecker Mar 3, 2020
453bfbc
json-rpc: Fix test_txprepare if running with postgres
cdecker Mar 17, 2020
e99ab03
pytest: Fix test_closing_fee regression in elements
cdecker Mar 17, 2020
c66b3d4
common: make sphinx use struct secret internally.
rustyrussell Mar 20, 2020
b122e44
common: new file hmac for hmac calculation.
rustyrussell Mar 20, 2020
8c984fb
common: make sphinx.c use hmac.c.
rustyrussell Mar 20, 2020
3e311b2
lightningd: fix assert() if spawning openingd fails.
rustyrussell Mar 25, 2020
e1ba42f
lightningd: always use BROKEN log level if we can't spawn a daemon.
rustyrussell Mar 25, 2020
80ff9c5
test: refactor lockup_drain add helpers drain and force_feerates
m-schmoock Mar 8, 2020
33c8afe
feat: adds receivable_msat to listpeers
m-schmoock Mar 5, 2020
ed56b22
fix: calc commit_txfee_spend/recv for spendable or receivable
m-schmoock Mar 8, 2020
c6495c1
doc: adds receivable_msat to manpage
m-schmoock Mar 5, 2020
0998164
test: receivable_msat similar to spendable_msat
m-schmoock Mar 5, 2020
e71e44a
pyln-testing: cleanup of pay() helper function
m-schmoock Mar 12, 2020
1aa8c90
chore: refactor and unify LOCAL/REMOTE helpers for receivable_msat
m-schmoock Mar 21, 2020
8cbc003
onchaind: a feerate per transaction type
darosior Mar 10, 2020
ad4bcfd
chaintopology: add delayed_to_us, htlc, and penalty feerates
darosior Mar 10, 2020
dce2e87
chaintopology: better feerate targets differentiation
darosior Mar 10, 2020
d4fe407
lightning/bitcoind: adapt and batch fees estimations
darosior Mar 5, 2020
5e72b22
bcli: adapt interface to the new fees estimation interface
darosior Mar 5, 2020
8a3295b
chaintopology: Add the cost of HTLCs transactions to json_feerates
darosior Mar 10, 2020
902edf5
libplugin: allow u32 options
darosior Mar 11, 2020
610aa0b
bcli: register --dev-max-fee-multiplier on our side
darosior Mar 11, 2020
0007af0
lightningd: remove deprecated 'description' parameter.
rustyrussell Mar 25, 2020
7583834
fundchannel/fundchannel_start: remove deprecated `satoshi` parameter
rustyrussell Mar 25, 2020
e940d95
fundchannel_start: We can't deprecate 'satoshi' here, since 'amount' …
rustyrussell Mar 25, 2020
7f32a84
listnodes/listpeers/peer_connected: remove deprecated `globalfeatures…
rustyrussell Mar 25, 2020
5d46204
lightningd: remove json_close `force` option.
rustyrussell Mar 25, 2020
a430abf
connectd: permit multiple descriptors of the same type.
rustyrussell Mar 30, 2020
d881a4b
BOLT: update to latest version.
rustyrussell Mar 30, 2020
c59327d
features: add support for channel_announcement features.
rustyrussell Mar 30, 2020
afb7639
common/features: use bitmaps internally, have explicit init function.
rustyrussell Mar 30, 2020
c95e58a
subdaemons: initialize feature routines with explicit feature_set.
rustyrussell Mar 30, 2020
a7cc6d3
plugins: actually change global features when plugins tell us to.
rustyrussell Mar 30, 2020
b7db588
plugin: remove boutique features.
rustyrussell Mar 30, 2020
13fbce9
common/amount: accept 0msat in parse_amount_sat()
darosior Mar 30, 2020
eead653
wallet: allow to withdraw with unconfirmed utxos
darosior Mar 16, 2020
26e906a
sendpay: do route parsing inside parameter parsing.
rustyrussell Mar 31, 2020
f76ab93
EXPERMENTAL_FEATURES: Import onion message types.
rustyrussell Mar 31, 2020
dd69055
channeld: handle onion messages.
rustyrussell Apr 1, 2020
f7fe8a9
lightningd: forward onion messages.
rustyrussell Apr 1, 2020
42af815
lightningd: EXPERIMENTAL_FEATURES JSON command to sendonionmessage.
rustyrussell Apr 1, 2020
e3dfba8
pytest: test sendonionmessage.
rustyrussell Apr 1, 2020
7422860
devtool/blindedpath: primitive tool to make blinded onions.
rustyrussell Apr 1, 2020
fcc68b9
devtools/blindedpath: add --simple-output for use from python.
rustyrussell Apr 1, 2020
8b8cbb9
channeld: handle encblob and blinding in messages.
rustyrussell Apr 1, 2020
23a36ac
plugins: expose onion_message hook (EXPERIMENTAL_FEATURES)
rustyrussell Apr 1, 2020
77e7bee
pytest: test the reply functionality (via blinded path) using a plugin.
rustyrussell Apr 1, 2020
7c0af81
bcli: use a more urgent feerate for HTLCs and penalty transactions
darosior Mar 10, 2020
15f5487
connectd: do feature bits check after init exchange.
rustyrussell Apr 2, 2020
cf43e44
common/features: don't use internal global.
rustyrussell Apr 2, 2020
7a95e90
plugins: add `feature_set` to init object.
rustyrussell Apr 2, 2020
8cb364d
libplugin: demarshal and stash the feature set given by lightningd.
rustyrussell Apr 2, 2020
41ebaff
lightningd: return `features` in connect response.
rustyrussell Apr 2, 2020
ca512e3
plugins/pay: use feature set from lightningd to decode bolt11.
rustyrussell Apr 2, 2020
79f2d2b
common/features: add option_support_large_channel.
rustyrussell Apr 2, 2020
1d90f21
lightningd / openingd: remove limits if we negotiate option_support_l…
rustyrussell Apr 3, 2020
07a281f
lightningd: add large-channels / wumbo option.
rustyrussell Apr 3, 2020
28e3ffc
plugins/fundchannel: make 'all' do the right thing for wumbo.
rustyrussell Apr 3, 2020
2f1502a
cleanup: make 'u8 *features' and 'struct feature_set *fset' more expl…
rustyrussell Apr 3, 2020
b0c58f8
doc: start an FAQ
darosior Feb 26, 2020
a5bd36c
faq: add two new questions asked on IRC
darosior Feb 26, 2020
d9fc99e
channeld: simplify loading of pre-existing HTLCs.
rustyrussell Apr 3, 2020
91251b1
common: add blinding helpers.
rustyrussell Apr 3, 2020
3b4a06f
common: generalize ecdh function.
rustyrussell Apr 3, 2020
2e8257e
channeld: plug minor leak.
rustyrussell Apr 3, 2020
891adfc
pay: Speed up `pay` and fix the shadow route construction
cdecker Apr 2, 2020
242ddb5
pyln-testing: allow to customize --allow-deprecated-apis
darosior Apr 2, 2020
5aafef1
pytest: skip some test when DEPRECATED_APIS is enabled.
darosior Apr 2, 2020
b8262c3
fundechannel: don't pass deprecated 'satoshis' to fundchannel_start
darosior Apr 3, 2020
117a839
lightningd: don't log BROKEN when we don't have a channel update.
rustyrussell Apr 5, 2020
ca36c21
doc: fix FAQ formatting
darosior Apr 4, 2020
3ce0552
build: use locale-independent sort for mocks
vasild Mar 10, 2020
158d221
closingd: configurable closing fee negotiation step
vasild Jan 3, 2020
ae06325
devtools: git ignore devtools/blindedpath
vasild Apr 7, 2020
662ac26
doc: fix typo: %s must be % (followup to 158d2212)
vasild Apr 7, 2020
d2165ff
lightningd: Don't accept 0sat for closing fee step
vasild Apr 7, 2020
11c21f9
devtools/decodemsg: don't crash if we have multiple tlv options.
rustyrussell Apr 7, 2020
72327f5
libplugin: fix compilation issue on recent gccs.
rustyrussell Apr 7, 2020
fe85cf9
Removing duplicated wscript generation for channel txs
dr-orlovsky Feb 18, 2020
65eb9d8
Fixing allocation context in funding wscript generation
dr-orlovsky Apr 6, 2020
3124d43
pay: check for null route in maybe_exclude
niftynei Apr 7, 2020
b51772f
pay: fix #3613; string output must be quoted
niftynei Apr 7, 2020
919d371
common/json_stream.c: Implement a `json_add_jsonstr` to add already-J…
ZmnSCPxj Apr 7, 2020
2540519
doc: document the plugin interface to gather Bitcoin data
darosior Apr 4, 2020
b68066e
python: Consolidate requirements.txt files in a single place
cdecker Apr 8, 2020
3b09662
pyln: Allow non-empty directory when creating node in node_factory
cdecker Apr 6, 2020
a696c84
fundchannel: Remove the now disabled deprecated `satoshi` param
cdecker Apr 6, 2020
8370a62
invoice: Parse amounts without a multiplier as BTC not msats
cdecker Apr 6, 2020
f00e9d6
doc: Give an example of the supported DSN formats
cdecker Apr 6, 2020
813356b
docs: Correct the key names for estimatefees
cdecker Apr 9, 2020
af76bce
pyln-client: send proper JSONRPC2 errors on failed call
darosior Apr 9, 2020
11acd90
pyln-testing: specify fallbackfee for newer versions of bitcoind
darosior Apr 8, 2020
7ae8e21
connectd: add darosior's seed node
darosior Apr 4, 2020
197a144
plugin: Ensure RPC passthrough calls are terminated when plugin dies
cdecker Apr 9, 2020
bf2a42a
channeld: defer first update_fee until we have an HTLC to send.
rustyrussell Apr 9, 2020
a9fe1a3
features: add EXPERIMENTAL option_onion_messages from draft.
rustyrussell Apr 11, 2020
990a3ec
EXPERIMENTAL: protocol TLV field for update_add_htlc to support blind…
rustyrussell Apr 11, 2020
f33b390
EXPERIMENTAL: onion TLV field for enctlv for blinding.
rustyrussell Apr 11, 2020
ae80787
EXPERIMENTAL: new error code for use when HTLC is blinded.
rustyrussell Apr 11, 2020
539a73e
common/onion: EXPERIMENTAL handling of enctlv field to override next_…
rustyrussell Apr 11, 2020
b29d1ed
channeld: support HTLCs with blinding (EXPERIMENTAL_FEATURES)
rustyrussell Apr 11, 2020
490a819
lightningd: add `blinding` and `enctlv` field to `struct route_hop`.
rustyrussell Apr 11, 2020
a85d40f
common/onion: add blinding and enctlv encoding.
rustyrussell Apr 11, 2020
23f3a3c
devtools/blindedpath: implement scid support.
rustyrussell Apr 11, 2020
1d29228
lightningd: make sendpay support `blinding` and `enctlv` fields (EXPE…
rustyrussell Apr 11, 2020
df31af5
invoice: ignore dead-end heuristic on explicitly specified channels.
rustyrussell Apr 8, 2020
1dc281c
pytest: test for pay adjacent routehint crash.
rustyrussell Apr 8, 2020
2c3543e
lightningd: fix crash when failing htlc once channeld dies.
rustyrussell Apr 15, 2020
1e34d89
utils: add marker for functions which take ownership of pointers.
rustyrussell Apr 15, 2020
9aedb0c
plugin: simplify hooks calling methods, and make lifetime requirement…
rustyrussell Apr 15, 2020
deac099
plugins: make chained hooks have two different callbacks.
rustyrussell Apr 15, 2020
284bd7d
pytest: fix flaky test_excluded_adjacent_routehint
rustyrussell Apr 15, 2020
27ea47a
plugins: Fix undefined deallocation order in `struct plugins`
cdecker Apr 12, 2020
5b11bab
plugin: Check that the preimage returned as resolution matches hash
cdecker Mar 26, 2020
5be59f4
plugin: Add keysend skeleton
cdecker Mar 27, 2020
ef0f28c
plugin: Implement the ability to receive keysend payments
cdecker Mar 30, 2020
1b32cc1
wire: Add a function to serialize a raw set of TLV fields
cdecker Apr 8, 2020
568773d
pytest: Add a test for keysend
cdecker Mar 30, 2020
b5b11a3
keysend: Ignore keysends if the payload contains unknown even fields
cdecker Mar 30, 2020
59567dc
plugin: Move feature_place enum to features.h
cdecker Mar 31, 2020
e03acd9
libplugin: Add features to plugin_main and getmanifest
cdecker Mar 31, 2020
97fb276
keysend: Announce keysend featurebit in node_announcement
cdecker Mar 31, 2020
f3315ca
pyln-proto: Add Tu32Field and Tu64Field helpers
cdecker Apr 8, 2020
6344107
lightningd: allow htlc_accepted hook to replace onion payload.
rustyrussell Apr 7, 2020
de0fd1f
keysend: Change the plugin to add an invoice and then continue
cdecker Apr 8, 2020
bf053dc
plugins: simplify htlc_accepted hook payload-setting API.
rustyrussell Apr 14, 2020
8189e9a
v0.8.2-rc1 Changelog updates
niftynei Apr 16, 2020
1b2f499
tests: on reconnect, we need to send any fulfills before adds
niftynei Apr 17, 2020
9663d11
build: make non-parallel
niftynei Apr 17, 2020
251bae5
build: Update build-release.sh to remove i386 build
niftynei Apr 17, 2020
9b42d9d
build: add mkrd to docker install?
niftynei Apr 17, 2020
f1633de
plugin: Add the keysend plugin to the list of installable plugins
cdecker Apr 19, 2020
264b2d1
pyln-testing: Add more meaningful error for mock_estimatefees
cdecker Apr 13, 2020
fb86617
wallet: Add a gap limit when checking for incoming transactions
cdecker Apr 14, 2020
ead2fde
Merge remote-tracking branch 'upstream/master' into 0.8.2
gruve-p Apr 20, 2020
82c1c4e
bitcoin > groestlcoin
gruve-p Apr 20, 2020
6b2f661
changelog: use correct format for label
niftynei Apr 20, 2020
fc86720
lightningd: fix false positive on leak detection.
rustyrussell Apr 21, 2020
c7da7ca
feerates: de-dupe min_ max_ printing twice when `feerates` called
niftynei Apr 24, 2020
10f47b4
changelog: update to rc2
niftynei Apr 23, 2020
6e5aa1a
doc: bitcoin backend must return sat/kVB not btc/kVB on `estimatefees`
darosior Apr 25, 2020
8c23f22
pytest: Reproduce issue #3666
cdecker Apr 27, 2020
9f29833
libplugin: It's featurebits, not features
cdecker Apr 27, 2020
d6d26dd
features: split expected feature bits into node/peer sets
niftynei Apr 28, 2020
f2aa770
tests: since features are longer now, so bytes read is longer
niftynei Apr 28, 2020
376ebe6
Merge remote-tracking branch 'upstream/master' into 0.8.2
gruve-p Apr 28, 2020
f637b88
v0.8.2rc3 changelog updates
niftynei Apr 28, 2020
6770382
0.8.2 Changelog Update
niftynei Apr 30, 2020
c485cf7
docs: Add documentation for Alpine to INSTALL.md
dr-bonez Apr 24, 2020
7ea1a8a
lightningd/bitcoind: remove an outdated comment
darosior Apr 28, 2020
678591d
lightningd/bitcoind: always die if the Bitcoin backend died
darosior Apr 28, 2020
3fc7773
bcli: don't log failed sendrawtransaction attempts twice
darosior Apr 28, 2020
20a88f8
Merge remote-tracking branch 'upstream/master' into 0.8.2
gruve-p May 1, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ trim_trailing_whitespace = true

[{**.c,**.h,Makefile}]
indent_style = tab
indent_size = 8

[**.py]
indent_style = space
Expand Down
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ external/libbacktrace.la
test/test_protocol
test/test_sphinx
tests/.pytest.restart
tests/plugins/test_libplugin
gossip_store
.pytest_cache
tools/headerversions
Expand All @@ -43,6 +44,4 @@ contrib/pylightning/pylightning.egg-info/
contrib/pyln-*/build/
contrib/pyln-*/dist/
contrib/pyln-*/pyln_*.egg-info/
devtools/create-gossipstore
contrib/compose/groestlcoin_datadir/
contrib/compose/clightning_groestlcoin_datadir/
plugins/keysend
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ env:
cache:
directories:
- dependencies
- external

script:
.travis/build.sh
2 changes: 0 additions & 2 deletions .travis/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ pip3 install --user -U --quiet --progress-bar off \

pip3 install --user -U --quiet --progress-bar off \
-r requirements.txt \
-r tests/requirements.txt \
-r doc/requirements.txt \
-r contrib/pyln-client/requirements.txt \
-r contrib/pyln-proto/requirements.txt \
-r contrib/pyln-testing/requirements.txt
Expand Down
82 changes: 80 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,84 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.8.1-rc3] - 2020-02-12: "Channel to the Moon"

## [0.8.2] - 2020-04-30: "A Scalable Ethereum Blockchain"

This release was named by @arowser.

### Added

- pay: The `keysend` plugin implements the ability to receive spontaneous payments (keysend) ([3611](https://github.com/ElementsProject/lightning/pull/3611))
- Plugin: the Bitcoin backend plugin API is now final. ([3620](https://github.com/ElementsProject/lightning/pull/3620))
- Plugin: `htlc_accepted` hook can now offer a replacement onion `payload`. ([3611](https://github.com/ElementsProject/lightning/pull/3611))
- Plugin: `feature_set` object added to `init` ([3612](https://github.com/ElementsProject/lightning/pull/3612))
- Plugin: 'flag'-type option now available. ([3586](https://github.com/ElementsProject/lightning/pull/3586))
- JSON API: New `getsharedsecret` command, which lets you compute a shared secret with this node knowing only a public point. This implements the BOLT standard of hashing the ECDH point, and is incompatible with ECIES. ([3490](https://github.com/ElementsProject/lightning/pull/3490))
- JSON API: `large-channels` option to negotiate opening larger channels. ([3612](https://github.com/ElementsProject/lightning/pull/3612))
- JSON API: New optional parameter to the `close` command to control the closing transaction fee negotiation back off step ([3390](https://github.com/ElementsProject/lightning/pull/3390))
- JSON API: `connect` returns `features` of the connected peer on success. ([3612](https://github.com/ElementsProject/lightning/pull/3612))
- JSON API: `listpeers` now has `receivable_msat` ([3572](https://github.com/ElementsProject/lightning/pull/3572))
- JSON API: The fields "opening", "mutual_close", "unilateral_close", "delayed_to_us", "htlc_resolution" and "penalty" have been added to the `feerates` command. ([3570](https://github.com/ElementsProject/lightning/pull/3570))
- JSON API: "htlc_timeout_satoshis" and "htlc_success_satoshis" fields have been added to the `feerates` command. ([3570](https://github.com/ElementsProject/lightning/pull/3570))
- pyln now sends proper error on bad calls to plugin methods ([3640](https://github.com/ElementsProject/lightning/pull/3640))
- devtools: The `onion` tool can now generate, compress and decompress onions for rendez-vous routing ([3557](https://github.com/ElementsProject/lightning/pull/3557))
- doc: An FAQ was added, accessible at https://lightning.readthedocs.io/FAQ.html ([3551](https://github.com/ElementsProject/lightning/pull/3551))

### Changed

- We now use a higher feerate for resolving onchain HTLCs and for penalty transactions ([3592](https://github.com/ElementsProject/lightning/pull/3592))
- We now announce multiple addresses of the same type, if given. ([3609](https://github.com/ElementsProject/lightning/pull/3609))
- pay: Improved the performance of the `pay`-plugin by limiting the `listchannels` when computing the shadow route. ([3617](https://github.com/ElementsProject/lightning/pull/3617))
- JSON API: `invoice` `exposeprivatechannels` now includes explicitly named channels even if they seem like dead-ends. ([3633](https://github.com/ElementsProject/lightning/pull/3633))
- Added workaround for lnd rejecting our commitment_signed when we send an update_fee after channel confirmed. ([3634](https://github.com/ElementsProject/lightning/pull/3634))
- We now batch the requests for fee estimation to our Bitcoin backend. ([3570](https://github.com/ElementsProject/lightning/pull/3570))
- We now get more fine-grained fee estimation from our Bitcoin backend. ([3570](https://github.com/ElementsProject/lightning/pull/3570))
- Forwarding messages is now much faster (less inter-daemon traffic) ([3547](https://github.com/ElementsProject/lightning/pull/3547))
- dependencies: We no longer depend on python2 which has reached end-of-life ([3552](https://github.com/ElementsProject/lightning/pull/3552))

### Deprecated

Note: You should always set `allow-deprecated-apis=false` to test for changes.

- JSON API: `fundchannel_start` `satoshi` field really deprecated now (use `amount`). ([3603](https://github.com/ElementsProject/lightning/pull/3603))
- JSON API: The "urgent", "slow", and "normal" field of the `feerates` command are now deprecated. ([3570](https://github.com/ElementsProject/lightning/pull/3570))
- JSON API: Removed double wrapping of `rpc_command` payload in `rpc_command` JSON field. ([3560](https://github.com/ElementsProject/lightning/pull/3560))
- Plugins: htlc_accepted_hook "failure_code" only handles simple cases now, use "failure_message". ([3472](https://github.com/ElementsProject/lightning/pull/3472))
- Plugins: invoice_payment_hook "failure_code" only handles simple cases now, use "failure_message". ([3472](https://github.com/ElementsProject/lightning/pull/3472))

### Removed

- JSON API: `listnodes` `globalfeatures` output (`features` since in 0.7.3). ([3603](https://github.com/ElementsProject/lightning/pull/3603))
- JSON API: `listpeers` `localfeatures` and `globalfeatures` output (`features` since in 0.7.3). ([3603](https://github.com/ElementsProject/lightning/pull/3603))
- JSON API: `peer_connected` hook `localfeatures` and `globalfeatures` output (`features` since in 0.7.3). ([3603](https://github.com/ElementsProject/lightning/pull/3603))
- JSON API: `fundchannel` and `fundchannel_start` `satoshi` parameter removed (renamed to `amount` in 0.7.3). ([3603](https://github.com/ElementsProject/lightning/pull/3603))
- JSON API: `close` `force` parameter removed (deprecated in 0.7.2.1) ([3603](https://github.com/ElementsProject/lightning/pull/3603))
- JSON API: `sendpay` `description` parameter removed (renamed to `label` in 0.7.0). ([3603](https://github.com/ElementsProject/lightning/pull/3603))

### Fixed

- Plugins: A crashing plugin will no longer cause a hook call to be delayed indefinitely ([3539](https://github.com/ElementsProject/lightning/pull/3539))
- Plugins: setting an 'init' feature bit allows us to accept it from peers. ([3609](https://github.com/ElementsProject/lightning/pull/3609))
- Plugins: if an option has a type int or bool, return the option as that type to the plugin's init ([3582](https://github.com/ElementsProject/lightning/pull/3582))
- Plugins: Plugins no longer linger indefinitely if their process terminates ([3539](https://github.com/ElementsProject/lightning/pull/3539))
- JSON API: Pending RPC method calls are now terminated if the handling plugin exits prematurely. ([3639](https://github.com/ElementsProject/lightning/pull/3639))
- JSON API: `fundchannel_start` returns `amount` even when deprecated APIs are enabled. ([3603](https://github.com/ElementsProject/lightning/pull/3603))
- JSON API: Passing 0 as minconf to withdraw allows you to use unconfirmed transaction outputs, even if explicitly passed as the `utxos` parameter ([3593](https://github.com/ElementsProject/lightning/pull/3593))
- JSON API: `txprepare` doesn't crash lightningd anymore if you pass unconfirmed utxos ([3534](https://github.com/ElementsProject/lightning/pull/3534))
- invoice: The invoice parser assumed that an amount without a multiplier was denominated in msatoshi instead of bitcoins. ([3636](https://github.com/ElementsProject/lightning/pull/3636))
- pay: The `pay`-plugin was generating non-contiguous shadow routes ([3617](https://github.com/ElementsProject/lightning/pull/3617))
- `pay` would crash on expired waits with tried routes ([3630](https://github.com/ElementsProject/lightning/pull/3630))
- `pay` would crash when attempting to find cheaper route with exemptfee ([3630](https://github.com/ElementsProject/lightning/pull/3630))
- Multiple definition of chainparams on Fedora (or other really recent gcc) ([3631](https://github.com/ElementsProject/lightning/pull/3631))
- bcli now handles 0msat outputs in gettxout. ([3605](https://github.com/ElementsProject/lightning/pull/3605))
- Fix assertion on reconnect if we fail to run openingd. ([3604](https://github.com/ElementsProject/lightning/pull/3604))
- Use lightning-rfc #740 feespike margin factor of 2 ([3589](https://github.com/ElementsProject/lightning/pull/3589))
- Always broadcast the latest close transaction at the end of the close fee negotiation, instead of sometimes broadcasting the peer's initial closing proposal. ([3556](https://github.com/ElementsProject/lightning/pull/3556))

### Security


## [0.8.1] - 2020-02-12: "Channel to the Moon"

This release named by Vasil Dimov @vasild.

Expand Down Expand Up @@ -635,7 +712,8 @@ There predate the BOLT specifications, and are only of vague historic interest:
6. [0.5.1] - 2016-10-21
7. [0.5.2] - 2016-11-21: "Bitcoin Savings & Trust Daily Interest II"

[0.8.1-rc3]: https://github.com/ElementsProject/lightning/releases/tag/v0.8.1-rc3
[0.8.2]: https://github.com/ElementsProject/lightning/releases/tag/v0.8.2
[0.8.1]: https://github.com/ElementsProject/lightning/releases/tag/v0.8.1
[0.8.0]: https://github.com/ElementsProject/lightning/releases/tag/v0.8.0
[0.7.3]: https://github.com/ElementsProject/lightning/releases/tag/v0.7.3
[0.7.2.1]: https://github.com/ElementsProject/lightning/releases/tag/v0.7.2.1
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ RUN mkdir /opt/groestlcoin && cd /opt/groestlcoin \
FROM debian:stretch-slim as builder

ENV LIGHTNINGD_VERSION=master
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates autoconf automake build-essential git libtool python python3 python3-mako wget gnupg dirmngr git gettext
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates autoconf automake build-essential git libtool python3 python3-mako wget gnupg dirmngr git gettext

RUN wget -q https://zlib.net/zlib-1.2.11.tar.gz \
&& tar xvf zlib-1.2.11.tar.gz \
Expand Down
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ CCANDIR := ccan

# Where we keep the BOLT RFCs
BOLTDIR := ../lightning-rfc/
BOLTVERSION := 17df7f2bba4dab844569c3305201606dee800741
BOLTVERSION := 4107c69e315b4f33d5b00459bef919bcfaa64bf2

-include config.vars

Expand Down Expand Up @@ -49,7 +49,7 @@ endif

ifeq ($(COMPAT),1)
# We support compatibility with pre-0.6.
COMPAT_CFLAGS=-DCOMPAT_V052=1 -DCOMPAT_V060=1 -DCOMPAT_V061=1 -DCOMPAT_V062=1 -DCOMPAT_V070=1 -DCOMPAT_V073=1 -DCOMPAT_V080=1
COMPAT_CFLAGS=-DCOMPAT_V052=1 -DCOMPAT_V060=1 -DCOMPAT_V061=1 -DCOMPAT_V062=1 -DCOMPAT_V070=1 -DCOMPAT_V072=1 -DCOMPAT_V073=1 -DCOMPAT_V080=1 -DCOMPAT_V081=1
endif

# Timeout shortly before the 600 second travis silence timeout
Expand Down Expand Up @@ -192,6 +192,12 @@ ALL_PROGRAMS =

CPPFLAGS += -DBINTOPKGLIBEXECDIR="\"$(shell sh tools/rel.sh $(bindir) $(pkglibexecdir))\""
CFLAGS = $(CPPFLAGS) $(CWARNFLAGS) $(CDEBUGFLAGS) $(COPTFLAGS) -I $(CCANDIR) $(EXTERNAL_INCLUDE_FLAGS) -I . -I/usr/local/include $(FEATURES) $(COVFLAGS) $(DEV_CFLAGS) -DSHACHAIN_BITS=48 -DJSMN_PARENT_LINKS $(PIE_CFLAGS) $(COMPAT_CFLAGS) -DBUILD_ELEMENTS=1
# If CFLAGS is already set in the environment of make (to whatever value, it
# does not matter) then it would export it to subprocesses with the above value
# we set, including CWARNFLAGS which by default contains -Wall -Werror. This
# breaks at least libwally-core which tries to switch off some warnings with
# -Wno-whatever. So, tell make to not export our CFLAGS to subprocesses.
unexport CFLAGS

# We can get configurator to run a different compile cmd to cross-configure.
CONFIGURATOR_CC := $(CC)
Expand Down Expand Up @@ -262,11 +268,11 @@ check: check-units installcheck pytest

pytest: $(ALL_PROGRAMS)
ifeq ($(PYTEST),)
@echo "py.test is required to run the integration tests, please install using 'pip3 install -r tests/requirements.txt', and rerun 'configure'."
@echo "py.test is required to run the integration tests, please install using 'pip3 install -r requirements.txt', and rerun 'configure'."
exit 1
else
# Explicitly hand DEVELOPER and VALGRIND so you can override on make cmd line.
PYTHONPATH=`pwd`/contrib/pyln-client:`pwd`/contrib/pyln-testing:`pwd`/contrib/pylightning:`pwd`/contrib/pyln-proto/:$(PYTHONPATH) TEST_DEBUG=1 DEVELOPER=$(DEVELOPER) VALGRIND=$(VALGRIND) $(PYTEST) tests/ $(PYTEST_OPTS)
PYTHONPATH=`pwd`/contrib/pyln-client:`pwd`/contrib/pyln-testing:`pwd`/contrib/pyln-proto/:$(PYTHONPATH) TEST_DEBUG=1 DEVELOPER=$(DEVELOPER) VALGRIND=$(VALGRIND) $(PYTEST) tests/ $(PYTEST_OPTS)
endif

# Keep includes in alpha order.
Expand Down Expand Up @@ -379,7 +385,7 @@ ccan/ccan/cdump/tools/cdump-enumstr.o: $(CCAN_HEADERS) Makefile

gen_version.h: FORCE
@(echo "#define VERSION \"$(VERSION)\"" && echo "#define BUILD_FEATURES \"$(FEATURES)\"") > [email protected]
@if cmp [email protected] $@ >/dev/null 2>&2; then rm -f [email protected]; else mv [email protected] $@; echo Version updated; fi
@if cmp [email protected] $@ >/dev/null 2>&1; then rm -f [email protected]; else mv [email protected] $@; echo Version updated; fi

# That forces this rule to be run every time, too.
gen_header_versions.h: tools/headerversions
Expand Down Expand Up @@ -503,7 +509,7 @@ PKGLIBEXEC_PROGRAMS = \
lightningd/lightning_hsmd \
lightningd/lightning_onchaind \
lightningd/lightning_openingd
PLUGINS=plugins/pay plugins/autoclean plugins/fundchannel plugins/bcli
PLUGINS=plugins/pay plugins/autoclean plugins/fundchannel plugins/bcli plugins/keysend

install-program: installdirs $(BIN_PROGRAMS) $(PKGLIBEXEC_PROGRAMS) $(PLUGINS)
@$(NORMAL_INSTALL)
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ c-lightning is a lightweight, highly customizable and [standard compliant][std]
* [Sending and Receiving Payments](#sending-and-receiving-payments)
* [Configuration File](#configuration-file)
* [Further Information](#further-information)
* [FAQ](doc/FAQ.md)
* [Pruning](#pruning)
* [HD wallet encryption](#hd-wallet-encryption)
* [Developers](#developers)
Expand Down Expand Up @@ -116,9 +117,7 @@ open a channel:
```bash
# Returns an address <address>
lightning-cli newaddr

# Returns a transaction id <txid>
groestlcoin-cli -testnet sendtoaddress <address> <amount_in_groestlcoins>
```

`lightningd` will register the funds once the transaction is confirmed.

Expand Down
8 changes: 4 additions & 4 deletions bitcoin/script.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <ccan/crypto/sha256/sha256.h>
#include <ccan/endian/endian.h>
#include <ccan/mem/mem.h>
#include <common/utils.h>

/* Some standard ops */
#define OP_0 0x00
Expand Down Expand Up @@ -451,8 +452,7 @@ u8 **bitcoin_witness_sig_and_element(const tal_t *ctx,

witness[0] = stack_sig(witness, sig);
witness[1] = tal_dup_arr(witness, u8, elem, elemsize, 0);
witness[2] = tal_dup_arr(witness, u8,
witnessscript, tal_count(witnessscript), 0);
witness[2] = tal_dup_talarr(witness, u8, witnessscript);

return witness;
}
Expand Down Expand Up @@ -675,7 +675,7 @@ u8 **bitcoin_witness_htlc_timeout_tx(const tal_t *ctx,
witness[1] = stack_sig(witness, remotehtlcsig);
witness[2] = stack_sig(witness, localhtlcsig);
witness[3] = stack_number(witness, 0);
witness[4] = tal_dup_arr(witness, u8, wscript, tal_count(wscript), 0);
witness[4] = tal_dup_talarr(witness, u8, wscript);

return witness;
}
Expand All @@ -692,7 +692,7 @@ u8 **bitcoin_witness_htlc_success_tx(const tal_t *ctx,
witness[1] = stack_sig(witness, remotesig);
witness[2] = stack_sig(witness, localhtlcsig);
witness[3] = stack_preimage(witness, preimage);
witness[4] = tal_dup_arr(witness, u8, wscript, tal_count(wscript), 0);
witness[4] = tal_dup_talarr(witness, u8, wscript);

return witness;
}
Expand Down
4 changes: 2 additions & 2 deletions bitcoin/short_channel_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ STRUCTEQ_DEF(short_channel_id, 0, u64);
/* BOLT #7:
*
* - MUST set `node_id_1` and `node_id_2` to the public keys of the two nodes
* operating the channel, such that `node_id_1` is the numerically-lesser of the
* two DER-encoded keys sorted in ascending numerical order.
* operating the channel, such that `node_id_1` is the lexicographically-lesser of the
* two compressed keys sorted in ascending lexicographic order.
*...
* - if the origin node is `node_id_1` in the message:
* - MUST set the `direction` bit of `channel_flags` to 0.
Expand Down
57 changes: 48 additions & 9 deletions bitcoin/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,28 +98,42 @@ static struct amount_sat bitcoin_tx_compute_fee(const struct bitcoin_tx *tx)
return fee;
}

int elements_tx_add_fee_output(struct bitcoin_tx *tx)
/**
* Add an explicit fee output if necessary.
*
* An explicit fee output is only necessary if we are using an elements
* transaction, and we have a non-zero fee. This method may be called multiple
* times.
*
* Returns the position of the fee output, or -1 in the case of non-elements
* transactions.
*/
static int elements_tx_add_fee_output(struct bitcoin_tx *tx)
{
struct amount_sat fee = bitcoin_tx_compute_fee(tx);
int pos = -1;
int pos;
struct witscript *w;

/* If we aren't using elements, we don't add explicit fee outputs */
if (!chainparams->is_elements || amount_sat_eq(fee, AMOUNT_SAT(0)))
return -1;

/* Try to find any existing fee output */
for (int i=0; i<tx->wtx->num_outputs; i++) {
if (elements_tx_output_is_fee(tx, i)) {
assert(pos == -1);
pos = i;
}
for (pos = 0; pos < tx->wtx->num_outputs; pos++) {
if (elements_tx_output_is_fee(tx, pos))
break;
}

if (pos == -1) {
if (pos == tx->wtx->num_outputs) {
w = tal(tx->output_witscripts, struct witscript);
w->ptr = tal_arr(w, u8, 0);
tx->output_witscripts[tx->wtx->num_outputs] = w;

/* Make sure we have a place to stash the witness script in. */
if (tal_count(tx->output_witscripts) < pos + 1) {
tal_resize(&tx->output_witscripts, pos + 1);
}
tx->output_witscripts[pos] = w;

return bitcoin_tx_add_output(tx, NULL, fee);
} else {
bitcoin_tx_output_set_amount(tx, pos, fee);
Expand Down Expand Up @@ -160,6 +174,12 @@ bool bitcoin_tx_check(const struct bitcoin_tx *tx)
size_t written;
int flags = WALLY_TX_FLAG_USE_WITNESS;

if (tal_count(tx->input_amounts) != tx->wtx->num_inputs)
return false;

if (tal_count(tx->output_witscripts) != tx->wtx->num_outputs)
return false;

if (wally_tx_get_length(tx->wtx, flags, &written) != WALLY_OK)
return false;

Expand Down Expand Up @@ -409,6 +429,19 @@ struct bitcoin_tx *bitcoin_tx(const tal_t *ctx,
return tx;
}

void bitcoin_tx_finalize(struct bitcoin_tx *tx)
{
size_t num_outputs, num_inputs;
elements_tx_add_fee_output(tx);

num_outputs = tx->wtx->num_outputs;
tal_resize(&(tx->output_witscripts), num_outputs);

num_inputs = tx->wtx->num_inputs;
tal_resize(&tx->input_amounts, num_inputs);
assert(bitcoin_tx_check(tx));
}

struct bitcoin_tx *pull_bitcoin_tx(const tal_t *ctx, const u8 **cursor,
size_t *max)
{
Expand Down Expand Up @@ -471,6 +504,12 @@ struct bitcoin_tx *bitcoin_tx_from_hex(const tal_t *ctx, const char *hex,
goto fail_free_tx;

tal_free(linear_tx);

tx->output_witscripts =
tal_arrz(tx, struct witscript *, tx->wtx->num_outputs);
tx->input_amounts =
tal_arrz(tx, struct amount_sat *, tx->wtx->num_inputs);

return tx;

fail_free_tx:
Expand Down
Loading