Browse Source

topogoly: Extract owned funds from transactions in blocks

Signed-off-by: Christian Decker <decker.christian@gmail.com>
ppa-0.6.1
Christian Decker 7 years ago
parent
commit
26aa0e2aa4
  1. 8
      lightningd/chaintopology.c

8
lightningd/chaintopology.c

@ -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…
Cancel
Save