simplify default label of tx
This commit is contained in:
@@ -1659,14 +1659,15 @@ class Abstract_Wallet(ABC, Logger, EventListener):
|
|||||||
labels = []
|
labels = []
|
||||||
tx = self.adb.get_transaction(tx_hash)
|
tx = self.adb.get_transaction(tx_hash)
|
||||||
if tx:
|
if tx:
|
||||||
for i in range(len(tx.outputs())):
|
|
||||||
outpoint = tx_hash + f':{i}'
|
|
||||||
if label := self.get_label_for_outpoint(outpoint):
|
|
||||||
labels.append(label)
|
|
||||||
for txin in tx.inputs():
|
for txin in tx.inputs():
|
||||||
outpoint = txin.prevout.to_str()
|
outpoint = txin.prevout.to_str()
|
||||||
if label := self.get_label_for_outpoint(outpoint):
|
if label := self.get_label_for_outpoint(outpoint):
|
||||||
labels.append(label)
|
labels.append('sweep ' + label)
|
||||||
|
if not labels:
|
||||||
|
for i in range(len(tx.outputs())):
|
||||||
|
outpoint = tx_hash + f':{i}'
|
||||||
|
if label := self.get_label_for_outpoint(outpoint):
|
||||||
|
labels.append(label)
|
||||||
|
|
||||||
# note: we don't deserialize tx as the history calls us for every tx, and that would be slow
|
# note: we don't deserialize tx as the history calls us for every tx, and that would be slow
|
||||||
if not self.db.get_txi_addresses(tx_hash):
|
if not self.db.get_txi_addresses(tx_hash):
|
||||||
|
|||||||
Reference in New Issue
Block a user