|
|
@ -208,6 +208,7 @@ class TxWalletDetails(NamedTuple): |
|
|
|
tx_mined_status: TxMinedInfo |
|
|
|
mempool_depth_bytes: Optional[int] |
|
|
|
can_remove: bool # whether user should be allowed to delete tx |
|
|
|
is_lightning_funding_tx: bool |
|
|
|
|
|
|
|
|
|
|
|
class Abstract_Wallet(AddressSynchronizer, ABC): |
|
|
@ -521,7 +522,11 @@ class Abstract_Wallet(AddressSynchronizer, ABC): |
|
|
|
exp_n = None |
|
|
|
can_broadcast = False |
|
|
|
can_bump = False |
|
|
|
tx_hash = tx.txid() |
|
|
|
tx_hash = tx.txid() # note: txid can be None! e.g. when called from GUI tx dialog |
|
|
|
is_lightning_funding_tx = False |
|
|
|
if self.has_lightning() and tx_hash is not None: |
|
|
|
is_lightning_funding_tx = any([chan.funding_outpoint.txid == tx_hash |
|
|
|
for chan in self.lnworker.channels.values()]) |
|
|
|
tx_we_already_have_in_db = self.db.get_transaction(tx_hash) |
|
|
|
can_save_as_local = (is_relevant and tx.txid() is not None |
|
|
|
and (tx_we_already_have_in_db is None or not tx_we_already_have_in_db.is_complete())) |
|
|
@ -571,6 +576,9 @@ class Abstract_Wallet(AddressSynchronizer, ABC): |
|
|
|
else: |
|
|
|
amount = None |
|
|
|
|
|
|
|
if is_lightning_funding_tx: |
|
|
|
can_bump = False # would change txid |
|
|
|
|
|
|
|
return TxWalletDetails( |
|
|
|
txid=tx_hash, |
|
|
|
status=status, |
|
|
@ -583,6 +591,7 @@ class Abstract_Wallet(AddressSynchronizer, ABC): |
|
|
|
tx_mined_status=tx_mined_status, |
|
|
|
mempool_depth_bytes=exp_n, |
|
|
|
can_remove=can_remove, |
|
|
|
is_lightning_funding_tx=is_lightning_funding_tx, |
|
|
|
) |
|
|
|
|
|
|
|
def get_spendable_coins(self, domain, *, nonlocal_only=False) -> Sequence[PartialTxInput]: |
|
|
|