Browse Source

remove last dependency on 'getbalance' RPC

The MMGen Project 5 years ago
parent
commit
944d7c3db7
1 changed files with 3 additions and 2 deletions
  1. 3 2
      mmgen/regtest.py

+ 3 - 2
mmgen/regtest.py

@@ -115,8 +115,9 @@ def get_balances():
 	g.testnet = True
 	rpc_init()
 	for u in (user1,user2):
-		bal = g.proto.coin_amt(g.rpch.getbalance('*',0,True))
-		if u == user1: user(user2)
+		bal = sum(e['amount'] for e in g.rpch.listunspent(0))
+		if u == user1:
+			user(user2)
 		msg('{:<16} {:12}'.format(u.capitalize()+"'s balance:",bal))
 		tbal += bal
 	msg('{:<16} {:12}'.format('Total balance:',tbal))