onchaind: Have onchaind also tell us the scriptPubKey of our outputs

onchaind is in the correct position to tell us about them, so have it pass
them up as well.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker
2019-02-22 16:36:09 +01:00
committed by neil saitug
parent df4e0a0022
commit 478e2d7084
4 changed files with 15 additions and 11 deletions

View File

@@ -272,11 +272,10 @@ static void onchain_add_utxo(struct channel *channel, const u8 *msg)
u->close_info->channel_id = channel->dbid;
u->close_info->peer_id = channel->peer->id;
u->spendheight = NULL;
u->scriptPubkey = NULL;
if (!fromwire_onchain_add_utxo(msg, &u->txid, &u->outnum,
&u->close_info->commitment_point,
&u->amount, &blockheight)) {
if (!fromwire_onchain_add_utxo(
u, msg, &u->txid, &u->outnum, &u->close_info->commitment_point,
&u->amount, &blockheight, &u->scriptPubkey)) {
fatal("onchaind gave invalid add_utxo message: %s", tal_hex(msg, msg));
}
u->blockheight = blockheight>0?&blockheight:NULL;