mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
gossip: Add function to notify gossipd about an outpoint spend
Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
parent
a8d587c418
commit
633f893ec4
@ -16,6 +16,7 @@
|
||||
#include <common/timeout.h>
|
||||
#include <common/utils.h>
|
||||
#include <inttypes.h>
|
||||
#include <lightningd/gossip_control.h>
|
||||
|
||||
/* Mutual recursion via timer. */
|
||||
static void try_extend_tip(struct chain_topology *topo);
|
||||
@ -415,6 +416,7 @@ static void topo_update_spends(struct chain_topology *topo, struct block *b)
|
||||
b->height, &input->txid,
|
||||
input->index);
|
||||
if (scid) {
|
||||
gossipd_notify_spend(topo->bitcoind->ld, scid);
|
||||
tal_free(scid);
|
||||
}
|
||||
}
|
||||
|
@ -216,6 +216,13 @@ void gossip_init(struct lightningd *ld)
|
||||
subd_send_msg(ld->gossip, msg);
|
||||
}
|
||||
|
||||
void gossipd_notify_spend(struct lightningd *ld,
|
||||
const struct short_channel_id *scid)
|
||||
{
|
||||
u8 *msg = towire_gossip_outpoint_spent(tmpctx, scid);
|
||||
subd_send_msg(ld->gossip, msg);
|
||||
}
|
||||
|
||||
static void json_getnodes_reply(struct subd *gossip UNUSED, const u8 *reply,
|
||||
const int *fds UNUSED,
|
||||
struct command *cmd)
|
||||
|
@ -1,10 +1,15 @@
|
||||
#ifndef LIGHTNING_LIGHTNINGD_GOSSIP_CONTROL_H
|
||||
#define LIGHTNING_LIGHTNINGD_GOSSIP_CONTROL_H
|
||||
#include "config.h"
|
||||
#include <bitcoin/short_channel_id.h>
|
||||
#include <ccan/short_types/short_types.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
struct lightningd;
|
||||
|
||||
void gossip_init(struct lightningd *ld);
|
||||
|
||||
void gossipd_notify_spend(struct lightningd *ld,
|
||||
const struct short_channel_id *scid);
|
||||
|
||||
#endif /* LIGHTNING_LIGHTNINGD_GOSSIP_CONTROL_H */
|
||||
|
Loading…
Reference in New Issue
Block a user