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

@@ -33,7 +33,7 @@ from typing import Dict, Optional, List, Tuple, Set, Iterable, NamedTuple, Seque
from . import util, bitcoin
from .util import profiler, WalletFileException, multisig_type, TxMinedInfo, bfh
from .keystore import bip44_derivation
from .transaction import Transaction, TxOutpoint, tx_from_any
from .transaction import Transaction, TxOutpoint, tx_from_any, PartialTransaction
from .logging import Logger
# seed_version is now used for the version of the wallet file
@@ -708,7 +708,7 @@ class JsonDB(Logger):
raise Exception(f"trying to add tx to db with inconsistent txid: {tx_hash} != {tx.txid()}")
# don't allow overwriting complete tx with partial tx
tx_we_already_have = self.transactions.get(tx_hash, None)
if tx_we_already_have is None or not tx_we_already_have.is_complete():
if tx_we_already_have is None or isinstance(tx_we_already_have, PartialTransaction):
self.transactions[tx_hash] = tx
@modifier