Skip to content

Commit

Permalink
tx dialog (Qt): if possible, save psbt and fully signed transaction u…
Browse files Browse the repository at this point in the history
…nder the same basename.
  • Loading branch information
ecdsa committed Apr 26, 2021
1 parent 4411652 commit 04b1e87
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions electrum/gui/qt/transaction_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,15 +346,15 @@ def export_to_file(self, *, tx: Transaction = None):
tx = self.tx
if isinstance(tx, PartialTransaction):
tx.finalize_psbt()
txid = tx.txid()
suffix = txid[0:8] if txid is not None else time.strftime('%Y%m%d-%H%M')
if tx.is_complete():
name = 'signed_%s' % (tx.txid()[0:8])
extension = 'txn'
default_filter = TRANSACTION_FILE_EXTENSION_FILTER_ONLY_COMPLETE_TX
else:
name = self.wallet.basename() + time.strftime('-%Y%m%d-%H%M')
extension = 'psbt'
default_filter = TRANSACTION_FILE_EXTENSION_FILTER_ONLY_PARTIAL_TX
name = f'{name}.{extension}'
name = f'{self.wallet.basename()}-{suffix}.{extension}'
fileName = getSaveFileName(
parent=self,
title=_("Select where to save your transaction"),
Expand Down

0 comments on commit 04b1e87

Please sign in to comment.