From 811d12c2dc77fac0523e71e74b2275bcdbc27433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Olav?= Date: Mon, 9 Sep 2024 11:34:00 +0200 Subject: [PATCH] sail/testchain: include immature balance --- packages/sidesail/lib/rpc/rpc_testchain.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/sidesail/lib/rpc/rpc_testchain.dart b/packages/sidesail/lib/rpc/rpc_testchain.dart index 968f5a2f..298c87fd 100644 --- a/packages/sidesail/lib/rpc/rpc_testchain.dart +++ b/packages/sidesail/lib/rpc/rpc_testchain.dart @@ -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