Skip to content

Commit

Permalink
Merge pull request JoinMarket-Org#160 from adlai/master
Browse files Browse the repository at this point in the history
bugfix: load transactions past the 1Kth
  • Loading branch information
chris-belcher committed Jul 24, 2015
2 parents f688fc4 + ecf5d08 commit b94553a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/blockchaininterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,12 +444,15 @@ def sync_addresses(self, wallet):
self.add_watchonly_addresses(wallet_addr_list, wallet_name)
return

#TODO get all the transactions above 1000, by looping until len(result) < 1000
ret = self.rpc(['listtransactions', wallet_name, '1000', '0', 'true'])
txs = json.loads(ret)
if len(txs) == 1000:
raise Exception(
'time to stop putting off this bug and actually fix it, see the TODO')
buf = json.loads(ret)
txs = buf
# If the buffer's full, check for more, until it ain't
while len(buf) == 1000:
ret = self.rpc(['listtransactions', wallet_name, '1000', str(len(
txs)), 'true'])
buf = json.loads(ret)
txs += buf
used_addr_list = [tx['address'] for tx in txs
if tx['category'] == 'receive']
too_few_addr_mix_change = []
Expand Down

0 comments on commit b94553a

Please sign in to comment.