Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.27 KB | None | 0 0
  1. diff --git a/lib/verifier.py b/lib/verifier.py
  2. index 20e83fd2..89694080 100644
  3. --- a/lib/verifier.py
  4. +++ b/lib/verifier.py
  5. @@ -36,15 +36,19 @@ class SPV(ThreadJob):
  6.          self.merkle_roots = {}
  7.  
  8.      def run(self):
  9. +        if not self.network.interface:
  10. +            return
  11.          lh = self.network.get_local_height()
  12.          unverified = self.wallet.get_unverified_txs()
  13. +        blockchain = self.network.blockchain()
  14.          for tx_hash, tx_height in unverified.items():
  15.              # do not request merkle branch before headers are available
  16.              if (tx_height > 0) and (tx_height <= lh):
  17. -                header = self.network.blockchain().read_header(tx_height)
  18. -                if header is None and self.network.interface:
  19. +                header = blockchain.read_header(tx_height)
  20. +                if header is None:
  21.                      index = tx_height // 2016
  22. -                    self.network.request_chunk(self.network.interface, index)
  23. +                    if index < len(blockchain.checkpoints):
  24. +                        self.network.request_chunk(self.network.interface, index)
  25.                  else:
  26.                      if tx_hash not in self.merkle_roots:
  27.                          request = ('blockchain.transaction.get_merkle',
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement