Skip to content

Commit

Permalink
sail/testchain: include immature balance
Browse files Browse the repository at this point in the history
  • Loading branch information
octobocto committed Sep 9, 2024
1 parent 2789a31 commit 811d12c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/sidesail/lib/rpc/rpc_testchain.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ class TestchainRPCLive extends TestchainRPC {

@override
Future<(double, double)> getBalance() async {
final confirmedFut = _client().call('getbalance');
final unconfirmedFut = _client().call('getunconfirmedbalance');
final walletInfo = await _client().call('getwalletinfo');
final confirmed = walletInfo['balance'] as double;
final unconfirmed = walletInfo['unconfirmed_balance'] as double;
final immature = walletInfo['immature_balance'] as double;

return (await confirmedFut as double, await unconfirmedFut as double);
return (confirmed, unconfirmed + immature);
}

@override
Expand Down

0 comments on commit 811d12c

Please sign in to comment.