1
0

wallet: allow saving partial txns as local (but require txid)

This commit is contained in:
SomberNight
2019-12-08 04:32:44 +01:00
parent 369d972aed
commit 30dcab0877
4 changed files with 23 additions and 12 deletions

View File

@@ -216,7 +216,8 @@ class AddressSynchronizer(Logger):
def add_transaction(self, tx: Transaction, *, allow_unrelated=False) -> bool:
"""Returns whether the tx was successfully added to the wallet history."""
assert tx, tx
assert tx.is_complete()
# note: tx.is_complete() is not necessarily True; tx might be partial
# but it *needs* to have a txid:
tx_hash = tx.txid()
if tx_hash is None:
raise Exception("cannot add tx without txid to wallet history")