mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
wallet: Move tx annotation for deposits into the wallet
We have split the iteration over the txs and the output in different functions, so pushing the annotation down, while keeping the transaction addition atop. This showcases the need to not have the txid reference the transactions.id in the DB: we annotate in a function that doesn't have the tx index context, but only add the TX after we have finished extracting.
This commit is contained in:
parent
3d14c18074
commit
ddae604f3d
@ -92,8 +92,6 @@ static void filter_block_txs(struct chain_topology *topo, struct block *b)
|
||||
tx, &b->height, &owned);
|
||||
wallet_transaction_add(topo->ld->wallet, tx, b->height,
|
||||
i);
|
||||
wallet_transaction_annotate(topo->ld->wallet, &txid,
|
||||
TX_WALLET_DEPOSIT, 0);
|
||||
}
|
||||
|
||||
/* We did spends first, in case that tells us to watch tx. */
|
||||
|
@ -1577,6 +1577,8 @@ int wallet_extract_owned_outputs(struct wallet *w, const struct bitcoin_tx *tx,
|
||||
type_to_string(tmpctx, struct amount_sat, total),
|
||||
type_to_string(tmpctx, struct amount_sat,
|
||||
&utxo->amount));
|
||||
|
||||
wallet_annotate_txout(w, &utxo->txid, output, TX_WALLET_DEPOSIT, 0);
|
||||
tal_free(utxo);
|
||||
num_utxos++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user