mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
synchronizer: test txid of received tx
This commit is contained in:
parent
9ebeb51153
commit
ceba4af01a
1 changed files with 4 additions and 1 deletions
|
@ -150,13 +150,16 @@ class Synchronizer(ThreadJob):
|
||||||
if not params:
|
if not params:
|
||||||
return
|
return
|
||||||
tx_hash = params[0]
|
tx_hash = params[0]
|
||||||
#assert tx_hash == hash_encode(Hash(bytes.fromhex(result)))
|
|
||||||
tx = Transaction(result)
|
tx = Transaction(result)
|
||||||
try:
|
try:
|
||||||
tx.deserialize()
|
tx.deserialize()
|
||||||
except Exception:
|
except Exception:
|
||||||
self.print_msg("cannot deserialize transaction, skipping", tx_hash)
|
self.print_msg("cannot deserialize transaction, skipping", tx_hash)
|
||||||
return
|
return
|
||||||
|
if tx_hash != tx.txid():
|
||||||
|
self.print_error("received tx does not match expected txid ({} != {})"
|
||||||
|
.format(tx_hash, tx.txid()))
|
||||||
|
return
|
||||||
tx_height = self.requested_tx.pop(tx_hash)
|
tx_height = self.requested_tx.pop(tx_hash)
|
||||||
self.wallet.receive_tx_callback(tx_hash, tx, tx_height)
|
self.wallet.receive_tx_callback(tx_hash, tx, tx_height)
|
||||||
self.print_error("received tx %s height: %d bytes: %d" %
|
self.print_error("received tx %s height: %d bytes: %d" %
|
||||||
|
|
Loading…
Add table
Reference in a new issue