Files
lightning/openingd/dualopend_wire.csv
niftynei 8225a9decf coin_mvt: log events for pushes/lease_fees for leased channels
We need to stash/save the amount of the lease fees on a leased channel,
we do this by re-using the 'push' amount field on channel (which is
technically correct, since we're essentially pushing the fee amount to
the peer).

Also updates a bit of how the pushes are accounted for (pushed to now
has an event; their channel will open at zero but then they'll
immediately register a push event).

Leases fees are treated exactly the same as pushes, except labeled
differently.

Required adding a 'lease_fee' field to the inflights so we keep track of
the fee for the lease until the open happens.
2021-12-28 04:42:42 +10:30

11 KiB

1#include <bitcoin/chainparams.h>
2#include <bitcoin/psbt.h>
3#include <common/cryptomsg.h>
4#include <common/channel_config.h>
5#include <common/channel_id.h>
6#include <common/derive_basepoints.h>
7#include <common/features.h>
8#include <common/fee_states.h>
9#include <common/htlc_wire.h>
10#include <common/penalty_base.h>
11#include <common/per_peer_state.h>
12#include <secp256k1.h>
13#include <wire/peer_wire.h>
14# Which network are we configured for?
15# Base configuration we'll offer
16# Minimum/maximum configuration values we'll accept
17# Constraints in case the other end tries to open a channel.
18# master-dualopend: peer has reconnected
19# master->dualopend: reply back with our first funding info/contribs
20# must go last because of embedded tu32
21# master->dualopend: reply back with our funding info/contribs
22# dualopend->master: is this a valid RBF candidate transaction?
23# master->dualopend: this is a valid RBF candidate transaction
24# master->dualopend: attempt an RBF
25# dualopend->master: ready to commit channel open to database and
26# get some signatures for the funding_tx.
27# dualopend->master: peer updated the psbt
28# master->dualopend: we updated the psbt
29# master->dualopend: fail this channel open
30# must go last because embedded tu32
31# dualopend->master received tx_sigs from peer
32# master->dualopend send our tx_sigs to peer
33# dualopend->master tx sigs transmitted to peer
34# dualopend->peer peer locked channel
35# dualopend->master this channel has been locked
36# master->dualopend funding reached depth; tell peer
37# Tell peer to shut down channel.
38# Peer told us that channel is shutting down
39# Peer presented proof it was from the future.
40# must go last because of embedded tu32
41# dualopend -> master: validate liqudity offer sig