Skip to content

Commit d1fd717

Browse files
committed
Confirmed balances have to be positive
h/t @sgeisler bitcoindevkit/rust-electrum-client#45 (comment)
1 parent bae4881 commit d1fd717

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/electrum/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ impl Connection {
286286
let (chain_stats, mempool_stats) = self.query.stats(&script_hash[..]);
287287

288288
Ok(json!({
289-
"confirmed": chain_stats.funded_txo_sum as i64 - chain_stats.spent_txo_sum as i64,
289+
"confirmed": chain_stats.funded_txo_sum - chain_stats.spent_txo_sum,
290290
"unconfirmed": mempool_stats.funded_txo_sum as i64 - mempool_stats.spent_txo_sum as i64,
291291
}))
292292
}

0 commit comments

Comments
 (0)