wallet: fix mismatch between two concepts of "balance"

One considers the blockchain, while the other considers the
blockchain and some recent actions, such as a recently created
transaction which spend some outputs, but isn't yet mined.

Typically, the "balance" command wants the latter, to reflect
the recent action, but things like proving ownership wants
the former.

This fixes a crash in get_reserve_proof, where a preliminary
check and the main code used two concepts of "balance".
This commit is contained in:
moneromooo-monero 2019-05-10 17:20:20 +00:00
parent cdfa2e58df
commit 2ec455df1f
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
7 changed files with 94 additions and 63 deletions

View file

@ -140,13 +140,14 @@ class Wallet(object):
}
return self.rpc.send_json_rpc_request(create_wallet)
def get_balance(self, account_index = 0, address_indices = [], all_accounts = False):
def get_balance(self, account_index = 0, address_indices = [], all_accounts = False, strict = False):
get_balance = {
'method': 'get_balance',
'params': {
'account_index': account_index,
'address_indices': address_indices,
'all_accounts': all_accounts,
'strict': strict,
},
'jsonrpc': '2.0',
'id': '0'