diff --git a/lightningd/onchain_control.c b/lightningd/onchain_control.c index 2f9a912fd..d43e67280 100644 --- a/lightningd/onchain_control.c +++ b/lightningd/onchain_control.c @@ -1285,7 +1285,6 @@ enum watch_result onchaind_funding_spent(struct channel *channel, struct lightningd *ld = channel->peer->ld; struct pubkey final_key; int hsmfd; - u32 feerates[4]; enum state_change reason; /* use REASON_ONCHAIN or closer's reason, if known */ @@ -1363,21 +1362,6 @@ enum watch_result onchaind_funding_spent(struct channel *channel, 64, &our_last_txid); - /* We try to get the feerate for each transaction type, 0 if estimation - * failed. */ - feerates[0] = delayed_to_us_feerate(ld->topology); - feerates[1] = htlc_resolution_feerate(ld->topology); - feerates[2] = penalty_feerate(ld->topology); - /* We check them separately but there is a high chance that if estimation - * failed for one, it failed for all.. */ - for (size_t i = 0; i < 3; i++) { - if (!feerates[i]) - feerates[i] = tx_feerate(channel->last_tx); - } - /* This is 10x highest bitcoind estimate (depending on dev-max-fee-multiplier), - * so cap at 2x */ - feerates[3] = feerate_max(ld, NULL) / 5; - log_debug(channel->log, "channel->static_remotekey_start[LOCAL] %"PRIu64, channel->static_remotekey_start[LOCAL]); @@ -1396,8 +1380,6 @@ enum watch_result onchaind_funding_spent(struct channel *channel, * we specify theirs. */ channel->channel_info.their_config.to_self_delay, channel->our_config.to_self_delay, - /* delayed_to_us, htlc, penalty, and penalty_max. */ - feerates[0], feerates[1], feerates[2], feerates[3], channel->our_config.dust_limit, &our_last_txid, channel->shutdown_scriptpubkey[LOCAL], diff --git a/onchaind/onchaind.c b/onchaind/onchaind.c index 50817b518..d9476fbc1 100644 --- a/onchaind/onchaind.c +++ b/onchaind/onchaind.c @@ -38,15 +38,6 @@ static const struct pubkey *remote_per_commitment_point; /* The commitment number we're dealing with (if not mutual close) */ static u64 commit_num; -/* The feerate for the transaction spending our delayed output. */ -static u32 delayed_to_us_feerate; - -/* The feerate for transactions spending HTLC outputs. */ -static u32 htlc_feerate; - -/* The feerate for transactions spending from revoked transactions. */ -static u32 penalty_feerate, max_penalty_feerate; - /* Min and max feerates we ever used */ static u32 min_possible_feerate, max_possible_feerate; @@ -3457,10 +3448,6 @@ int main(int argc, char *argv[]) &remote_per_commit_point, &to_self_delay[LOCAL], &to_self_delay[REMOTE], - &delayed_to_us_feerate, - &htlc_feerate, - &penalty_feerate, - &max_penalty_feerate, &dust_limit, &our_broadcast_txid, &scriptpubkey[LOCAL], @@ -3488,9 +3475,6 @@ int main(int argc, char *argv[]) master_badmsg(WIRE_ONCHAIND_INIT, msg); } - status_debug("delayed_to_us_feerate = %u, htlc_feerate = %u, " - "penalty_feerate = %u", delayed_to_us_feerate, - htlc_feerate, penalty_feerate); /* We need to keep tx around, but there's only one: not really a leak */ tal_steal(ctx, notleak(tx)); diff --git a/onchaind/onchaind_wire.csv b/onchaind/onchaind_wire.csv index 62c6719e8..f8a513d78 100644 --- a/onchaind/onchaind_wire.csv +++ b/onchaind/onchaind_wire.csv @@ -20,10 +20,6 @@ msgdata,onchaind_init,old_remote_per_commitment_point,pubkey, msgdata,onchaind_init,remote_per_commitment_point,pubkey, msgdata,onchaind_init,local_to_self_delay,u32, msgdata,onchaind_init,remote_to_self_delay,u32, -msgdata,onchaind_init,delayed_to_us_feerate,u32, -msgdata,onchaind_init,htlc_feerate,u32, -msgdata,onchaind_init,penalty_feerate,u32, -msgdata,onchaind_init,max_penalty_feerate,u32, msgdata,onchaind_init,local_dust_limit_satoshi,amount_sat, # Gives an easy way to tell if it's our unilateral close or theirs... msgdata,onchaind_init,our_broadcast_txid,bitcoin_txid, diff --git a/onchaind/test/run-grind_feerate.c b/onchaind/test/run-grind_feerate.c index 273b4ea2b..3f225adbc 100644 --- a/onchaind/test/run-grind_feerate.c +++ b/onchaind/test/run-grind_feerate.c @@ -51,7 +51,7 @@ bool fromwire_onchaind_dev_memleak(const void *p UNNEEDED) bool fromwire_onchaind_htlcs(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, struct htlc_stub **htlc UNNEEDED, bool **tell_if_missing UNNEEDED, bool **tell_immediately UNNEEDED) { fprintf(stderr, "fromwire_onchaind_htlcs called!\n"); abort(); } /* Generated stub for fromwire_onchaind_init */ -bool fromwire_onchaind_init(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, struct shachain *shachain UNNEEDED, const struct chainparams **chainparams UNNEEDED, struct amount_sat *funding_amount_satoshi UNNEEDED, struct amount_msat *our_msat UNNEEDED, struct pubkey *old_remote_per_commitment_point UNNEEDED, struct pubkey *remote_per_commitment_point UNNEEDED, u32 *local_to_self_delay UNNEEDED, u32 *remote_to_self_delay UNNEEDED, u32 *delayed_to_us_feerate UNNEEDED, u32 *htlc_feerate UNNEEDED, u32 *penalty_feerate UNNEEDED, u32 *max_penalty_feerate UNNEEDED, struct amount_sat *local_dust_limit_satoshi UNNEEDED, struct bitcoin_txid *our_broadcast_txid UNNEEDED, u8 **local_scriptpubkey UNNEEDED, u8 **remote_scriptpubkey UNNEEDED, u32 *ourwallet_index UNNEEDED, struct ext_key *ourwallet_ext_key UNNEEDED, struct pubkey *ourwallet_pubkey UNNEEDED, enum side *opener UNNEEDED, struct basepoints *local_basepoints UNNEEDED, struct basepoints *remote_basepoints UNNEEDED, struct tx_parts **tx_parts UNNEEDED, u32 *locktime UNNEEDED, u32 *tx_blockheight UNNEEDED, u32 *reasonable_depth UNNEEDED, struct bitcoin_signature **htlc_signature UNNEEDED, u32 *min_possible_feerate UNNEEDED, u32 *max_possible_feerate UNNEEDED, struct pubkey **possible_remote_per_commit_point UNNEEDED, struct pubkey *local_funding_pubkey UNNEEDED, struct pubkey *remote_funding_pubkey UNNEEDED, u64 *local_static_remotekey_start UNNEEDED, u64 *remote_static_remotekey_start UNNEEDED, bool *option_anchor_outputs UNNEEDED, u32 *min_relay_feerate UNNEEDED) +bool fromwire_onchaind_init(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, struct shachain *shachain UNNEEDED, const struct chainparams **chainparams UNNEEDED, struct amount_sat *funding_amount_satoshi UNNEEDED, struct amount_msat *our_msat UNNEEDED, struct pubkey *old_remote_per_commitment_point UNNEEDED, struct pubkey *remote_per_commitment_point UNNEEDED, u32 *local_to_self_delay UNNEEDED, u32 *remote_to_self_delay UNNEEDED, struct amount_sat *local_dust_limit_satoshi UNNEEDED, struct bitcoin_txid *our_broadcast_txid UNNEEDED, u8 **local_scriptpubkey UNNEEDED, u8 **remote_scriptpubkey UNNEEDED, u32 *ourwallet_index UNNEEDED, struct ext_key *ourwallet_ext_key UNNEEDED, struct pubkey *ourwallet_pubkey UNNEEDED, enum side *opener UNNEEDED, struct basepoints *local_basepoints UNNEEDED, struct basepoints *remote_basepoints UNNEEDED, struct tx_parts **tx_parts UNNEEDED, u32 *locktime UNNEEDED, u32 *tx_blockheight UNNEEDED, u32 *reasonable_depth UNNEEDED, struct bitcoin_signature **htlc_signature UNNEEDED, u32 *min_possible_feerate UNNEEDED, u32 *max_possible_feerate UNNEEDED, struct pubkey **possible_remote_per_commit_point UNNEEDED, struct pubkey *local_funding_pubkey UNNEEDED, struct pubkey *remote_funding_pubkey UNNEEDED, u64 *local_static_remotekey_start UNNEEDED, u64 *remote_static_remotekey_start UNNEEDED, bool *option_anchor_outputs UNNEEDED, u32 *min_relay_feerate UNNEEDED) { fprintf(stderr, "fromwire_onchaind_init called!\n"); abort(); } /* Generated stub for fromwire_onchaind_known_preimage */ bool fromwire_onchaind_known_preimage(const void *p UNNEEDED, struct preimage *preimage UNNEEDED)