wallet history: also add fiat value to child tx
What changed, and why it matters
This commit is a minor user-interface fix for Electrum's transaction history. Previously, when showing a group of related transactions, the fiat (local currency) value was only shown for the parent/group entry and not for each child transaction. The change loops through both the parent and child entries so each gets its own fiat value. There is no indication this is a security fix; it appears to be a display completeness improvement.
No security action required. Treat as a normal functional/UI improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In electrum/wallet.py, the get_full_history method now applies fiat-value enrichment to each child transaction in addition to the root item. The code restructures the existing include_fiat block into a loop over [item] + children, calling get_tx_item_fiat or computing a fallback fiat_value for each. No cryptographic, network, or permission logic is changed.
Changed components
electrum/wallet.pyAbstract_Wallet.get_full_historyInspect captured patch +12 / −9
diff --git a/electrum/wallet.py b/electrum/wallet.py
index e28778a..814a8be 100644
--- a/electrum/wallet.py
+++ b/electrum/wallet.py
@@ -1514,17 +1514,20 @@ class Abstract_Wallet(ABC, Logger, EventListener):
item['value'] = item.get('bc_value', Satoshis(0)) + item.get('ln_value', Satoshis(0))
for child in item.get('children', []):
child['value'] = child.get('bc_value', Satoshis(0)) + child.get('ln_value', Satoshis(0))
- if include_fiat:
- value = item['value'].value
- txid = item.get('txid')
- if not item.get('lightning') and txid:
- fiat_fields = self.get_tx_item_fiat(tx_hash=txid, amount_sat=value, fx=fx, tx_fee=item['fee_sat'])
- item.update(fiat_fields)
+ if not include_fiat:
+ continue
+ # add fiat values to both the root item and its children
+ for add_fiat_item in [item] + children:
+ value = add_fiat_item['value'].value
+ txid = add_fiat_item.get('txid')
+ if not add_fiat_item.get('lightning') and txid:
+ fiat_fields = self.get_tx_item_fiat(tx_hash=txid, amount_sat=value, fx=fx, tx_fee=add_fiat_item['fee_sat'])
+ add_fiat_item.update(fiat_fields)
else:
- timestamp = item['timestamp'] or now
+ timestamp = add_fiat_item['timestamp'] or now
fiat_value = value / Decimal(bitcoin.COIN) * fx.timestamp_rate(timestamp)
- item['fiat_value'] = Fiat(fiat_value, fx.ccy)
- item['fiat_default'] = True
+ add_fiat_item['fiat_value'] = Fiat(fiat_value, fx.ccy)
+ add_fiat_item['fiat_default'] = True
return transactions
@profiler
Why this scored 18/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.