Skip to content
This repository has been archived by the owner on Feb 3, 2025. It is now read-only.

Unfilter force cloes balance #864

Merged
merged 2 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions docs/Testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ Things to test before cutting a release:
- Restoring with an encryption password
- Export logs
- Try with and without encryption password
- Mutual Close Channel
- Known Issue: balance will be double counted until 6 confirmations
- Force Close Channel
16 changes: 8 additions & 8 deletions mutiny-core/src/nodemanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ use bitcoin::{Address, Network, OutPoint, Transaction, Txid};
use core::time::Duration;
use esplora_client::Builder;
use futures::{future::join_all, lock::Mutex};
use lightning::chain::channelmonitor::Balance;
TonyGiorgio marked this conversation as resolved.
Show resolved Hide resolved
use lightning::chain::Confirm;
use lightning::events::ClosureReason;
use lightning::ln::channelmanager::{ChannelDetails, PhantomRouteHints};
Expand Down Expand Up @@ -1357,13 +1356,14 @@ impl<S: MutinyStorage> NodeManager<S> {
n.chain_monitor.get_claimable_balances(&ignored_channels)
})
// need to filter out pending mutual closes, these are counted in the on-chain balance
.filter(|b| {
!matches!(
b,
Balance::ClaimableOnChannelClose { .. }
| Balance::ClaimableAwaitingConfirmations { .. }
)
})
// comment out for now until https://github.com/lightningdevkit/rust-lightning/issues/2738
// .filter(|b| {
// !matches!(
// b,
// Balance::ClaimableOnChannelClose { .. }
// | Balance::ClaimableAwaitingConfirmations { .. }
// )
// })
.map(|bal| bal.claimable_amount_satoshis())
.sum();

Expand Down
Loading