From 4234321f7e551ba09aa22efca0845aa88c02ac8e Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 3 Apr 2018 14:01:48 +0930 Subject: [PATCH] onchain: get feerate min/max from master. Signed-off-by: Rusty Russell --- lightningd/onchain_control.c | 3 ++- onchaind/onchain.c | 6 ++++-- onchaind/onchain_wire.csv | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lightningd/onchain_control.c b/lightningd/onchain_control.c index 64f5270a6..071f25e4d 100644 --- a/lightningd/onchain_control.c +++ b/lightningd/onchain_control.c @@ -417,7 +417,8 @@ enum watch_result funding_spent(struct channel *channel, /* FIXME: config for 'reasonable depth' */ 3, channel->last_htlc_sigs, - tal_count(stubs)); + tal_count(stubs), + 0, 250000); subd_send_msg(channel->owner, take(msg)); /* FIXME: Don't queue all at once, use an empty cb... */ diff --git a/onchaind/onchain.c b/onchaind/onchain.c index 5dd4e63b0..a080f0be3 100644 --- a/onchaind/onchain.c +++ b/onchaind/onchain.c @@ -34,7 +34,7 @@ static const struct keyset *keyset; static u32 feerate_per_kw; /* Min and max feerates we ever used */ -static u32 min_possible_feerate = 0, max_possible_feerate = 250000; +static u32 min_possible_feerate, max_possible_feerate; /* The dust limit to use when we generate transactions. */ static u64 dust_limit_satoshis; @@ -2133,7 +2133,9 @@ int main(int argc, char *argv[]) &tx_blockheight, &reasonable_depth, &remote_htlc_sigs, - &num_htlcs)) { + &num_htlcs, + &min_possible_feerate, + &max_possible_feerate)) { master_badmsg(WIRE_ONCHAIN_INIT, msg); } diff --git a/onchaind/onchain_wire.csv b/onchaind/onchain_wire.csv index 688d09f2b..21a86dd3d 100644 --- a/onchaind/onchain_wire.csv +++ b/onchaind/onchain_wire.csv @@ -31,6 +31,8 @@ onchain_init,,reasonable_depth,u32 onchain_init,,num_htlc_sigs,u16 onchain_init,,htlc_signature,num_htlc_sigs*secp256k1_ecdsa_signature onchain_init,,num_htlcs,u64 +onchain_init,,min_possible_feerate,u32 +onchain_init,,max_possible_feerate,u32 #include # This is all the HTLCs: one per message