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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user