Skip to content

Commit

Permalink
Merge branch 'jssdwt-use-to-us-msat'
Browse files Browse the repository at this point in the history
  • Loading branch information
JssDWt committed Jun 24, 2024
2 parents 42ca8fa + c5c4299 commit 9e61f8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/sdk-core/src/greenlight/node_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ impl Greenlight {
) -> Result<u64> {
let pending_onchain_balance = peer_channels.iter().fold(0, |a, b| match b.state() {
ChanneldShuttingDown | ClosingdSigexchange | ClosingdComplete | AwaitingUnilateral
| FundingSpendSeen => a + b.min_to_us_msat.clone().unwrap_or_default().msat,
| FundingSpendSeen => a + b.to_us_msat.clone().unwrap_or_default().msat,

// When we unilaterally close the channel it will get status as `AwaitingUnilateral`
// first, but when the closing transaction is confirmed onchain the funds receive status
Expand All @@ -563,7 +563,7 @@ impl Greenlight {
.last()
.is_some_and(|status| status.contains("DELAYED_OUTPUT_TO_US"))
{
a + b.min_to_us_msat.clone().unwrap_or_default().msat
a + b.to_us_msat.clone().unwrap_or_default().msat
} else {
a
}
Expand Down

0 comments on commit 9e61f8b

Please sign in to comment.