1
0

select the longest blockchain from several servers

This commit is contained in:
thomasv
2013-09-02 17:49:12 +02:00
parent 48efc62b2d
commit 2a6e8927dd
3 changed files with 177 additions and 83 deletions

View File

@@ -155,4 +155,14 @@ class TxVerifier(threading.Thread):
def undo_verifications(self, height):
with self.lock:
items = self.verified_tx.items()[:]
for tx_hash, item in items:
tx_height, timestamp, pos = item
if tx_height >= height:
print_error("redoing", tx_hash)
with self.lock:
self.verified_tx.pop(tx_hash)
if tx_hash in self.merkle_roots:
self.merkle_roots.pop(tx_hash)