bitcoind: tell bitcoind_poll_transactions's callback if tx is a coinbase.

In this case, the inputs aren't valid transactions, so don't try to
find them.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2016-01-22 06:41:49 +10:30
parent 5b9f8d8bbd
commit 0dbbd81430
3 changed files with 31 additions and 13 deletions

View File

@@ -187,7 +187,9 @@ static void tx_watched_inputs(struct lightningd_state *dstate,
static void watched_transaction(struct lightningd_state *dstate,
const struct sha256_double *txid,
int confirmations)
int confirmations,
bool is_coinbase)
{
struct txwatch *txw;
@@ -206,7 +208,8 @@ static void watched_transaction(struct lightningd_state *dstate,
insert_txwatch(dstate, dstate, NULL, txid, NULL, NULL);
/* Maybe it spent an output we're watching? */
bitcoind_txid_lookup(dstate, txid, tx_watched_inputs, NULL);
if (!is_coinbase)
bitcoind_txid_lookup(dstate, txid, tx_watched_inputs, NULL);
}
static struct timeout watch_timeout;