mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-03 20:44:54 +01:00
158d2212c2
When negotiating the transaction fee for closing a channel [1], we used to always pick the middle of the range between our proposal and the peer's proposal. Introduce a new option `fee_negotiation_step` to the close command, so the peer who initiates the close can choose his back off step. Partially resolves https://github.com/ElementsProject/lightning/issues/3270 [1] https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md#closing-negotiation-closing_signed Changelog-Added: New optional parameter to the `close` command to control the closing transaction fee negotiation back off step
45 lines
1.9 KiB
Plaintext
45 lines
1.9 KiB
Plaintext
#include <common/cryptomsg.h>
|
|
#include <common/htlc_wire.h>
|
|
#include <common/per_peer_state.h>
|
|
# Begin! (passes peer fd, gossipd-client fd)
|
|
msgtype,closing_init,2001
|
|
msgdata,closing_init,chainparams,chainparams,
|
|
msgdata,closing_init,pps,per_peer_state,
|
|
msgdata,closing_init,funding_txid,bitcoin_txid,
|
|
msgdata,closing_init,funding_txout,u16,
|
|
msgdata,closing_init,funding_satoshi,amount_sat,
|
|
msgdata,closing_init,local_fundingkey,pubkey,
|
|
msgdata,closing_init,remote_fundingkey,pubkey,
|
|
msgdata,closing_init,funder,enum side,
|
|
msgdata,closing_init,local_sat,amount_sat,
|
|
msgdata,closing_init,remote_sat,amount_sat,
|
|
msgdata,closing_init,our_dust_limit,amount_sat,
|
|
msgdata,closing_init,min_fee_satoshi,amount_sat,
|
|
msgdata,closing_init,fee_limit_satoshi,amount_sat,
|
|
msgdata,closing_init,initial_fee_satoshi,amount_sat,
|
|
msgdata,closing_init,local_scriptpubkey_len,u16,
|
|
msgdata,closing_init,local_scriptpubkey,u8,local_scriptpubkey_len
|
|
msgdata,closing_init,remote_scriptpubkey_len,u16,
|
|
msgdata,closing_init,remote_scriptpubkey,u8,remote_scriptpubkey_len
|
|
msgdata,closing_init,fee_negotiation_step,u64,
|
|
msgdata,closing_init,fee_negotiation_step_unit,u8,
|
|
msgdata,closing_init,reconnected,bool,
|
|
msgdata,closing_init,next_index_local,u64,
|
|
msgdata,closing_init,next_index_remote,u64,
|
|
msgdata,closing_init,revocations_received,u64,
|
|
msgdata,closing_init,channel_reestablish_len,u16,
|
|
msgdata,closing_init,channel_reestablish,u8,channel_reestablish_len
|
|
msgdata,closing_init,last_remote_secret,secret,
|
|
msgdata,closing_init,dev_fast_gossip,bool,
|
|
|
|
# We received an offer, save signature.
|
|
msgtype,closing_received_signature,2002
|
|
msgdata,closing_received_signature,signature,bitcoin_signature,
|
|
msgdata,closing_received_signature,tx,bitcoin_tx,
|
|
|
|
msgtype,closing_received_signature_reply,2102
|
|
msgdata,closing_received_signature_reply,closing_txid,bitcoin_txid,
|
|
|
|
# Negotiations complete, we're exiting.
|
|
msgtype,closing_complete,2004
|