mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
lightningd: don't crash when txout lookup fails.
Gossipd already correctly handles the "empty output means lookup failed" case. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -60,9 +60,16 @@ static void got_txout(struct bitcoind *bitcoind,
|
||||
const struct bitcoin_tx_output *output,
|
||||
struct short_channel_id *scid)
|
||||
{
|
||||
const u8 *script;
|
||||
|
||||
/* output will be NULL if it wasn't found */
|
||||
if (output)
|
||||
script = output->script;
|
||||
else
|
||||
script = NULL;
|
||||
|
||||
subd_send_msg(bitcoind->ld->gossip,
|
||||
towire_gossip_get_txout_reply(scid, scid, output->script));
|
||||
towire_gossip_get_txout_reply(scid, scid, script));
|
||||
tal_free(scid);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user