mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
balance_snapshot: don't count unconfirmed utxos
This was causing journal_entries to show up in the accountant plugin, since we don't emit events for unconfirmed events until they're actually confirmed onchain.
This commit is contained in:
parent
b33868f7c2
commit
9075c74e3d
@ -107,6 +107,9 @@ void send_account_balance_snapshot(struct lightningd *ld, u32 blockheight)
|
||||
for (size_t i = 0; i < ARRAY_SIZE(utxo_states); i++) {
|
||||
utxos = wallet_get_utxos(NULL, ld->wallet, utxo_states[i]);
|
||||
for (size_t j = 0; j < tal_count(utxos); j++) {
|
||||
/* Don't count unconfirmed utxos! */
|
||||
if (!utxos[j]->spendheight && !utxos[j]->blockheight)
|
||||
continue;
|
||||
if (!amount_msat_add_sat(&bal->balance,
|
||||
bal->balance, utxos[j]->amount))
|
||||
fatal("Overflow adding node balance");
|
||||
|
Loading…
Reference in New Issue
Block a user