Skip to content

Commit

Permalink
Merge pull request #864 from MutinyWallet/unfilter-fc-bal
Browse files Browse the repository at this point in the history
Unfilter force cloes balance
  • Loading branch information
TonyGiorgio authored Nov 17, 2023
2 parents 577b340 + 121e5be commit 6dce839
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
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;
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

0 comments on commit 6dce839

Please sign in to comment.