Skip to content

Commit

Permalink
Bug fixes for rpa manager
Browse files Browse the repository at this point in the history
  • Loading branch information
fyookball committed Jun 4, 2021
1 parent b962992 commit b83f7f3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions electroncash/rpa_manager.py
Expand Up @@ -89,6 +89,10 @@ def rpa_phase_1(self):
if rpa_height < server_height:

number_of_blocks = 50
# Only request enough blocks to get to the tip. Otherwise, the next request will be too far ahead
if rpa_height+number_of_blocks > server_height:
number_of_blocks = server_height-rpa_height

# Define the "grind string" (the RPA prefix)
rpa_grind_string = self.wallet.get_grind_string()
params = [rpa_height, number_of_blocks, rpa_grind_string]
Expand All @@ -114,6 +118,10 @@ def rpa_phase_2(self, response):
method = response.get('method')
params = response.get('params')

# Payload can be empty occassionally, especially if there's poor network connectivity.
if payload is None:
return

for i in payload:
txid = i['tx_hash']
tx_height = i['height']
Expand Down

0 comments on commit b83f7f3

Please sign in to comment.