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
Gracefully handle fee-larger-than-claimed-value in ChannelMonitor
This resulted in a full_stack_target failure as we overflow during
subtraction otherwise.
Instead, we try lower and lower fee estimator confirmation targets
until we find one low enough, or discard the transaction. We should
be able to handle this much cleaner, but for now this at least gets
the fuzzer working again.
log_error!($self,"Failed to generate an on-chain punishment tx spending {} as even low priority fee ({} sat) was more than the entire claim balance ({} sat)",
424
+
$spent_txid, fee, $value);
425
+
false
426
+
} else {
427
+
log_warn!($self,"Used low priority fee for on-chain punishment tx spending {} as high priority fee was more than the entire claim balance ({} sat)",
428
+
$spent_txid, $value);
429
+
$value -= fee;
430
+
true
431
+
}
432
+
} else {
433
+
log_warn!($self,"Used medium priority fee for on-chain punishment tx spending {} as high priority fee was more than the entire claim balance ({} sat)",
434
+
$spent_txid, $value);
435
+
$value -= fee;
436
+
true
437
+
}
438
+
} else {
439
+
$value -= fee;
440
+
true
441
+
}
442
+
}
443
+
}
444
+
}
445
+
414
446
#[cfg(any(test, feature = "fuzztarget"))]
415
447
/// Used only in testing and fuzztarget to check serialization roundtrips don't change the
416
448
/// underlying object
@@ -1200,11 +1232,12 @@ impl ChannelMonitor {
1200
1232
}),
1201
1233
};
1202
1234
let predicted_weight = single_htlc_tx.get_weight() + Self::get_witnesses_weight(&[if htlc.offered{InputDescriptors::RevokedOfferedHTLC}else{InputDescriptors::RevokedReceivedHTLC}]);
0 commit comments