1
0

wallet: introduce namedtuples TxMinedStatus and VerifiedTxInfo

This commit is contained in:
SomberNight
2018-07-31 16:49:57 +02:00
parent 41e088693d
commit a29e2218c8
8 changed files with 79 additions and 58 deletions

View File

@@ -23,7 +23,7 @@
from typing import Sequence, Optional
from .util import ThreadJob, bh2u
from .util import ThreadJob, bh2u, VerifiedTxInfo
from .bitcoin import Hash, hash_decode, hash_encode
from .transaction import Transaction
from .blockchain import hash_header
@@ -110,7 +110,8 @@ class SPV(ThreadJob):
except KeyError: pass
self.print_error("verified %s" % tx_hash)
header_hash = hash_header(header)
self.wallet.add_verified_tx(tx_hash, (tx_height, header.get('timestamp'), pos, header_hash))
vtx_info = VerifiedTxInfo(tx_height, header.get('timestamp'), pos, header_hash)
self.wallet.add_verified_tx(tx_hash, vtx_info)
if self.is_up_to_date() and self.wallet.is_up_to_date():
self.wallet.save_verified_tx(write=True)