1
0

synchronizer: request tx from server if we only have partial local tx

Note that there is a slight distinction between
`not tx.is_complete()` and `isinstance(tx, PartialTransaction)`,
which is that technically you can have a PSBT that is already complete
but was not yet converted to a standard bitcoin tx.
This commit is contained in:
SomberNight
2019-12-16 21:15:20 +01:00
parent 7b49832a3f
commit 72491bdf18
2 changed files with 6 additions and 5 deletions

View File

@@ -30,7 +30,7 @@ import logging
from aiorpcx import TaskGroup, run_in_thread, RPCError
from .transaction import Transaction
from .transaction import Transaction, PartialTransaction
from .util import bh2u, make_aiohttp_session, NetworkJobOnDefaultServer
from .bitcoin import address_to_scripthash, is_address
from .network import UntrustedServerReturnedError
@@ -196,8 +196,9 @@ class Synchronizer(SynchronizerBase):
for tx_hash, tx_height in hist:
if tx_hash in self.requested_tx:
continue
if self.wallet.db.get_transaction(tx_hash):
continue
tx = self.wallet.db.get_transaction(tx_hash)
if tx and not isinstance(tx, PartialTransaction):
continue # already have complete tx
transaction_hashes.append(tx_hash)
self.requested_tx[tx_hash] = tx_height