core-lightning/lightningd/onchain_control.h
lisa neigut 9caf20f636 coin moves: don't log coin moves in onchaind if we're replaying
On node start we replay onchaind's transactions from the database/from
our loaded htlc table.  To keep things tidy, we shouldn't notify the
ledger about these, so we wrap pretty much everything in a flag that
tells us whether or not this is a replay.

There's a very small corner case where dust transactions will get missed
if the node crashes after the htlc has been added to the database but
before we've successfully notified onchaind about it.

Notably, most of the obtrusive updates to onchaind wrappings are due to
the fact that we record dust (ignored outputs) before we receive
confirmation of its confirmation.
2020-05-12 15:46:58 +09:30

20 lines
536 B
C

#ifndef LIGHTNING_LIGHTNINGD_ONCHAIN_CONTROL_H
#define LIGHTNING_LIGHTNINGD_ONCHAIN_CONTROL_H
#include "config.h"
#include <ccan/short_types/short_types.h>
#include <lightningd/lightningd.h>
#include <onchaind/gen_onchain_wire.h>
struct channel;
struct bitcoin_tx;
struct block;
enum watch_result onchaind_funding_spent(struct channel *channel,
const struct bitcoin_tx *tx,
u32 blockheight,
bool is_replay);
void onchaind_replay_channels(struct lightningd *ld);
#endif /* LIGHTNING_LIGHTNINGD_ONCHAIN_CONTROL_H */