You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement bumping engine in ChannelMonitor::block_connected
Add RBF-bumping of justice txn, given they are only signed by us we
can RBF at wish.
Aggregation of bump-candidates and more aggresive bumping heuristics
are left open
Fix tests broken by introduction of more txn broadcast
//TODO: iter on buffered TxMaterial in our_claim_txn_waiting_first_conf, if block timer is expired generate a bumped claim tx (RBF or CPFP accordingly)
log_trace!(self,"Outpoint {}:{} is under claiming process, if it doesn't succeed, a bumped claiming txn is going to be broadcast at height {}",(tx.0).vout,(tx.0).txid,(tx.1).0);
/// Lightning security model (i.e being able to redeem/timeout HTLC or penalize coutnerparty onchain) lays on the assumption of claim transactions getting confirmed before timelock expiration
2363
+
/// (CSV or CLTV following cases). In case of high-fee spikes, claim tx may stuck in the mempool, so you need to bump its feerate quickly using Replace-By-Fee or Child-Pay-For-Parent.
2364
+
// TODO: we may use smarter heuristics to aggregate-at-bumping if we add timelock in cached materials
// If old feerate inferior to actual one given back by Fee Estimator, use it to compute new fee...
2385
+
let new_fee = if $old_feerate < $fee_estimator.get_est_sat_per_1000_weight(ConfirmationTarget::HighPriority){
2386
+
letmut value = $amount;
2387
+
if subtract_high_prio_fee!(self, $fee_estimator, value, $predicted_weight, $outpoint.txid){
2388
+
$amount - value
2389
+
} else {
2390
+
log_trace!(self,"Can't new-estimation bump claiming on {} output {} from {}, amount {} is too small", $output, $outpoint.vout, $outpoint.txid, $amount);
2391
+
returnNone;
2392
+
}
2393
+
// ...else just increase the previous feerate by 25% (because that's a nice number)
2394
+
} else {
2395
+
let fee = $old_feerate * $predicted_weight / 750;
2396
+
if $amount <= fee {
2397
+
log_trace!(self,"Can't 25% bump claiming on {} output {} from {}, amount {} is too small", $output, $outpoint.vout, $outpoint.txid, $amount);
2398
+
returnNone;
2399
+
}
2400
+
fee
2401
+
};
2402
+
2403
+
let previous_fee = $old_feerate * $predicted_weight / 1000;
2404
+
let min_relay_fee = $fee_estimator.get_min_relay_sat_per_1000_weight()* $predicted_weight / 1000;
2405
+
// BIP 125 Opt-in Full Replace-by-Fee Signaling
2406
+
// * 3. The replacement transaction pays an absolute fee of at least the sum paid by the original transactions.
2407
+
// * 4. The replacement transaction must also pay for its own bandwidth at or above the rate set by the node's minimum relay fee setting.
2408
+
let new_fee = if new_fee < previous_fee + min_relay_fee {
0 commit comments