mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
8f33f46960
We were actually using the last commit tx's size, since we were setting it in lightningd. Instead, hand the min and desired feerates to closingd, and (as it knows the weight of the closing tx), and have it start negotiation from there. This can be significantly less when anchor outputs are enabled: for example in test_closing.py, the commit tx weight is 1124 Sipa, the close is 672 Sipa! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Changed: Protocol: Use a more accurate fee for mutual close negotiation.
1.7 KiB
1.7 KiB
1 | #include <bitcoin/tx.h> |
---|---|
2 | #include <common/channel_id.h> |
3 | #include <common/cryptomsg.h> |
4 | #include <common/htlc_wire.h> |
5 | #include <common/per_peer_state.h> |
6 | # Begin! (passes peer fd, gossipd-client fd) |
7 | msgtype,closingd_init,2001 |
8 | msgdata,closingd_init,chainparams,chainparams, |
9 | msgdata,closingd_init,pps,per_peer_state, |
10 | msgdata,closingd_init,channel_id,channel_id, |
11 | msgdata,closingd_init,funding_txid,bitcoin_txid, |
12 | msgdata,closingd_init,funding_txout,u16, |
13 | msgdata,closingd_init,funding_satoshi,amount_sat, |
14 | msgdata,closingd_init,local_fundingkey,pubkey, |
15 | msgdata,closingd_init,remote_fundingkey,pubkey, |
16 | msgdata,closingd_init,opener,enum side, |
17 | msgdata,closingd_init,local_sat,amount_sat, |
18 | msgdata,closingd_init,remote_sat,amount_sat, |
19 | msgdata,closingd_init,our_dust_limit,amount_sat, |
20 | msgdata,closingd_init,min_feerate_perksipa,u32, |
21 | msgdata,closingd_init,preferred_feerate_perksipa,u32, |
22 | msgdata,closingd_init,fee_limit_satoshi,amount_sat, |
23 | msgdata,closingd_init,local_scriptpubkey_len,u16, |
24 | msgdata,closingd_init,local_scriptpubkey,u8,local_scriptpubkey_len |
25 | msgdata,closingd_init,remote_scriptpubkey_len,u16, |
26 | msgdata,closingd_init,remote_scriptpubkey,u8,remote_scriptpubkey_len |
27 | msgdata,closingd_init,fee_negotiation_step,u64, |
28 | msgdata,closingd_init,fee_negotiation_step_unit,u8, |
29 | msgdata,closingd_init,dev_fast_gossip,bool, |
30 | msgdata,closingd_init,shutdown_wrong_funding,?bitcoin_outpoint, |
31 | # We received an offer, save signature. |
32 | msgtype,closingd_received_signature,2002 |
33 | msgdata,closingd_received_signature,signature,bitcoin_signature, |
34 | msgdata,closingd_received_signature,tx,bitcoin_tx, |
35 | msgtype,closingd_received_signature_reply,2102 |
36 | msgdata,closingd_received_signature_reply,closing_txid,bitcoin_txid, |
37 | # Negotiations complete, we're exiting. |
38 | msgtype,closingd_complete,2004 |