Skip to content

Commit f6a8fd5

Browse files
committed
Merge branch 'master' into mustache
2 parents 7c86bc1 + 6607574 commit f6a8fd5

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

otsserver/stamper.py

+12-7
Original file line numberDiff line numberDiff line change
@@ -300,13 +300,18 @@ def __do_bitcoin(self):
300300
self.pending_commitments.add(reorged_commitment_timestamp.msg)
301301

302302
# Check if this block contains any of the pending transactions
303-
304-
try:
305-
block = proxy.getblock(block_hash)
306-
except KeyError:
307-
# Must have been a reorg or something, return
308-
logging.error("Failed to get block")
309-
return
303+
block = None
304+
while block is None:
305+
try:
306+
block = proxy.getblock(block_hash)
307+
except KeyError:
308+
# Must have been a reorg or something, return
309+
logging.error("Failed to get block")
310+
return
311+
except BrokenPipeError:
312+
logging.error("BrokenPipeError to get block")
313+
time.sleep(5)
314+
proxy = bitcoin.rpc.Proxy()
310315

311316
# the following is an optimization, by pre computing the tx_id we rapidly check if our unconfirmed tx
312317
# is in the block

0 commit comments

Comments
 (0)