mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
gossip: Pass output value to gossipd
Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
parent
cb4ba9bf4f
commit
a8e553098a
@ -1813,8 +1813,9 @@ static struct io_plan *handle_txout_reply(struct io_conn *conn,
|
||||
{
|
||||
struct short_channel_id scid;
|
||||
u8 *outscript;
|
||||
u64 satoshis;
|
||||
|
||||
if (!fromwire_gossip_get_txout_reply(msg, msg, &scid, &outscript))
|
||||
if (!fromwire_gossip_get_txout_reply(msg, msg, &scid, &satoshis, &outscript))
|
||||
master_badmsg(WIRE_GOSSIP_GET_TXOUT_REPLY, msg);
|
||||
|
||||
if (handle_pending_cannouncement(daemon->rstate, &scid, outscript))
|
||||
|
@ -191,6 +191,7 @@ gossip_get_txout,,short_channel_id,struct short_channel_id
|
||||
# master->gossipd here is the output, or empty if none.
|
||||
gossip_get_txout_reply,3118
|
||||
gossip_get_txout_reply,,short_channel_id,struct short_channel_id
|
||||
gossip_get_txout_reply,,satoshis,u64
|
||||
gossip_get_txout_reply,,len,u16
|
||||
gossip_get_txout_reply,,outscript,len*u8
|
||||
|
||||
|
|
@ -66,15 +66,19 @@ static void got_txout(struct bitcoind *bitcoind,
|
||||
struct short_channel_id *scid)
|
||||
{
|
||||
const u8 *script;
|
||||
u64 satoshis = 0;
|
||||
|
||||
/* output will be NULL if it wasn't found */
|
||||
if (output)
|
||||
if (output) {
|
||||
script = output->script;
|
||||
else
|
||||
satoshis = output->amount;
|
||||
} else {
|
||||
script = NULL;
|
||||
}
|
||||
|
||||
subd_send_msg(bitcoind->ld->gossip,
|
||||
towire_gossip_get_txout_reply(scid, scid, script));
|
||||
subd_send_msg(
|
||||
bitcoind->ld->gossip,
|
||||
towire_gossip_get_txout_reply(scid, scid, satoshis, script));
|
||||
tal_free(scid);
|
||||
}
|
||||
|
||||
@ -92,8 +96,9 @@ static void get_txout(struct subd *gossip, const u8 *msg)
|
||||
op = wallet_outpoint_for_scid(gossip->ld->wallet, scid, scid);
|
||||
|
||||
if (op) {
|
||||
subd_send_msg(gossip, towire_gossip_get_txout_reply(
|
||||
scid, scid, op->scriptpubkey));
|
||||
subd_send_msg(gossip,
|
||||
towire_gossip_get_txout_reply(
|
||||
scid, scid, op->satoshis, op->scriptpubkey));
|
||||
tal_free(scid);
|
||||
} else {
|
||||
bitcoind_getoutput(gossip->ld->topology->bitcoind,
|
||||
|
Loading…
Reference in New Issue
Block a user