balance_snapshot: emit balances for channels that are awaiting_lockin

9cad7d6a6a changed the behavior of `channel_active`, which slightly
broke how our balance snapshots work (we need info about channels that
aren't on-chain yet).

This patches adds AWAITING_UNILATERAL back in.
This commit is contained in:
niftynei 2022-07-28 22:53:25 -05:00 committed by Rusty Russell
parent 10d66c25c4
commit a675f4c24e

View file

@ -121,7 +121,8 @@ void send_account_balance_snapshot(struct lightningd *ld, u32 blockheight)
/* Add channel balances */
list_for_each(&ld->peers, p, list) {
list_for_each(&p->channels, chan, list) {
if (channel_active(chan)) {
if (channel_active(chan)
|| chan->state == AWAITING_UNILATERAL) {
bal = tal(snap, struct account_balance);
bal->bip173_name = chainparams->lightning_hrp;
bal->acct_id = type_to_string(bal,