mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
topogoly: Extract owned funds from transactions in blocks
Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
parent
d912d45af8
commit
26aa0e2aa4
@ -58,6 +58,7 @@ static void connect_block(struct chain_topology *topo,
|
|||||||
struct block *b)
|
struct block *b)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
u64 satoshi_owned;
|
||||||
|
|
||||||
assert(b->height == -1);
|
assert(b->height == -1);
|
||||||
assert(b->prev == NULL);
|
assert(b->prev == NULL);
|
||||||
@ -86,9 +87,14 @@ static void connect_block(struct chain_topology *topo,
|
|||||||
txowatch_fire(topo, txo, tx, j, b);
|
txowatch_fire(topo, txo, tx, j, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
satoshi_owned = 0;
|
||||||
|
wallet_extract_owned_outputs(topo->bitcoind->ld->wallet, tx,
|
||||||
|
&satoshi_owned);
|
||||||
|
|
||||||
/* We did spends first, in case that tells us to watch tx. */
|
/* We did spends first, in case that tells us to watch tx. */
|
||||||
bitcoin_txid(tx, &txid);
|
bitcoin_txid(tx, &txid);
|
||||||
if (watching_txid(topo, &txid) || we_broadcast(topo, &txid))
|
if (watching_txid(topo, &txid) || we_broadcast(topo, &txid) ||
|
||||||
|
satoshi_owned != 0)
|
||||||
add_tx_to_block(b, tx, i);
|
add_tx_to_block(b, tx, i);
|
||||||
}
|
}
|
||||||
b->full_txs = tal_free(b->full_txs);
|
b->full_txs = tal_free(b->full_txs);
|
||||||
|
Loading…
Reference in New Issue
Block a user