Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

close channel estimate fee must less than 80% of initiator balance #51

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mutiny-core/src/nodemanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1725,10 +1725,10 @@ impl<S: MutinyStorage> NodeManager<S> {
};
if let Some(feerate_pkw) = target_feerate_sats_per_1000_weight {
let estimate_fee: u64 = ((close_tx_weight * feerate_pkw) / 1000).into();
if estimate_fee > (initiator_balance >> 1) {
if estimate_fee > (initiator_balance * 8 / 10) {
log_warn!(
self.logger,
"close channel with feerate_pkw({feerate_pkw}) close_tx_weight({close_tx_weight}) estimate fee({estimate_fee}) is more than 50% initiator balance ({initiator_balance})",
"close channel with feerate_pkw({feerate_pkw}) close_tx_weight({close_tx_weight}) estimate fee({estimate_fee}) is more than 80% initiator balance ({initiator_balance})",
);
return Err(MutinyError::InvalidFeerate);
}
Expand Down
Loading