bkpr: for zerconfs, we still wanna know you're opening a channel

We need a record of the channel account before you start sending
payments through it. Normally we don't start allowing payments to be
sent until after the channel has locked in but zeroconf does away with
this assumption.

Instead we push out a "channel_proposed" event, which should only show
up for zeroconfs.
This commit is contained in:
niftynei
2022-07-19 14:35:56 -05:00
committed by Rusty Russell
parent 1b5dc4409a
commit 30aa1d79fb
8 changed files with 94 additions and 26 deletions

View File

@@ -627,11 +627,10 @@ enum watch_result onchaind_funding_spent(struct channel *channel,
/* If we haven't posted the open event yet, post an open */
if (!channel->scid || !channel->remote_funding_locked) {
u32 blkh;
/* Note that blockheight will be zero if it's not in chain
* yet */
/* Blockheight will be zero if it's not in chain */
blkh = wallet_transaction_height(channel->peer->ld->wallet,
&channel->funding.txid);
channel_record_open(channel, blkh);
channel_record_open(channel, blkh, true);
}