Commit Graph

9 Commits

Author SHA1 Message Date
niftynei 71a4a2e31c df: rework closing logic
Trying to put all the disconnect logic into the same path was a dumb
idea. If you asked to reconnect but passed in an 'unsaved' channel, we
would not call the 'reconnect' code.

Instead, we make a differentiation between "unsaved" channels
(ones that we haven't received commitment tx for) and handle the
disconnect for these separate from where we want to do a reconnect.
2021-05-12 11:25:41 +09:30
niftynei 8cc2919884 connectd: clean up the channel stuffs when we get a reconnect
If they've disconnected/reconnected we need to terminate all the
inflight stuff, plus go ahead and call 'disconnect' plugin trigger etc.
2021-03-06 15:03:56 +10:30
niftynei 07153bff6a df: cleanup error handling on lightningd side
Make existing methods understand how unsaved channels work, re-work
errors so that we handle everything appropriately
2021-03-06 15:03:56 +10:30
niftynei a23277af57 listpeers: include info on channels that are in-process
Channels that we're in negotiation for, but don't have a commitment
transaction saved for yet.
2021-03-06 15:03:56 +10:30
niftynei da81d4bced channel: skip unsaved channels
Now that "peer->channels" contains `unsaved` channels, skip overthem
where appropriate
2021-03-03 16:19:04 -06:00
niftynei b8b910e4c4 df-rbf: update channel data on depth reached
When the funding tx reaches depth, update the channel's data to the
"correct" funding transaction info from inflights (if necessary).

This will be necessary if:
    - the transaction has been successfully RBF'd and
    - the lesser fee transaction is the one successfully mined, OR
    - the channel is in the process of being RBF'd
2021-03-03 12:28:22 +10:30
niftynei 9fdf1ea32a df: reinitialize dual-funding
Prior to this, all reconnect logic lived in channeld. If you
disconnected before we finished building a funding transaction, that was
no big deal. Now, however, we're waiting for the funding to lock in in
dualopend, instead of handing straight to channeld to wait.

So we need a way to restart dualopend.
2021-01-10 13:44:04 +01:00
niftynei 1ea4e63331 dual-open: handle sigs and channel lockin in dualopend, not channeld
This will make it possible to do RBF, since we can re-start the opening
process in dualopend while waiting for lock-in.

Note the new channel states are being used, DUALOPEND_INIT and
DUALOPEND_AWAITING_LOCKIN, to differentiate from openingd/channeld opens
2021-01-10 13:44:04 +01:00
niftynei 59525853ae dual-fund: accepter side implementation on lightningd
wherein we add the dual_open_control functions
2020-09-09 19:54:20 +09:30