chaintopology: track three different feerates.

Depending on what we're doing, we can want different ones.  So use
IMMEDIATE (estimatesmartfee 2 CONSERVATIVE), NORMAL (estimatesmartfee
4 ECONOMICAL) and SLOW (estimatesmartfee 100 ECONOMICAL).

If one isn't available, we try making each one half the previous.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-11-21 14:00:29 +10:30
committed by Christian Decker
parent ef4d54df94
commit 7151c65535
5 changed files with 166 additions and 48 deletions

View File

@@ -55,18 +55,20 @@ struct bitcoind *new_bitcoind(const tal_t *ctx,
void wait_for_bitcoind(struct bitcoind *bitcoind);
void bitcoind_estimate_fee_(struct bitcoind *bitcoind,
void (*cb)(struct bitcoind *bitcoind,
u64 satoshi_per_kw, void *),
void *arg);
void bitcoind_estimate_fees_(struct bitcoind *bitcoind,
const u32 blocks[], const char *estmode[],
size_t num_estimates,
void (*cb)(struct bitcoind *bitcoind,
const u64 satoshi_per_kw[], void *),
void *arg);
#define bitcoind_estimate_fee(bitcoind_, cb, arg) \
bitcoind_estimate_fee_((bitcoind_), \
typesafe_cb_preargs(void, void *, \
(cb), (arg), \
struct bitcoind *, \
u64), \
(arg))
#define bitcoind_estimate_fees(bitcoind_, blocks, estmode, num, cb, arg) \
bitcoind_estimate_fees_((bitcoind_), (blocks), (estmode), (num), \
typesafe_cb_preargs(void, void *, \
(cb), (arg), \
struct bitcoind *, \
const u64 *), \
(arg))
void bitcoind_sendrawtx_(struct bitcoind *bitcoind,
const char *hextx,