Files
lightning/daemon/chaintopology.h
Rusty Russell b5a6ac26c7 watch: don't hand blockhash, have commit_tx_depth() use get_last_mediantime()
There isn't a single blockhash; we may be on multiple forks.  But the one
caller which cares is commit_tx_depth(), which wants to know if the tx is
spendable yet.  So that uses get_last_mediantime().

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-04-24 19:50:35 +09:30

20 lines
634 B
C

#ifndef LIGHTNING_DAEMON_CHAINTOPOLOGY_H
#define LIGHTNING_DAEMON_CHAINTOPOLOGY_H
#include "config.h"
#include <stddef.h>
struct lightningd_state;
struct txwatch;
/* This is the number of blocks which would have to be mined to invalidate
* the tx. */
size_t get_tx_depth(struct lightningd_state *dstate, const struct txwatch *w);
/* This is the worst-case (latest) mediantime of blocks including the txid.
* Assumes the depth is > 0! */
u32 get_last_mediantime(struct lightningd_state *dstate,
const struct sha256_double *txid);
void setup_topology(struct lightningd_state *dstate);
#endif /* LIGHTNING_DAEMON_CRYPTOPKT_H */