Merge pull request #11068 from f321x/get_full_history_labels
What changed, and why it matters
This is a small performance optimization in the Electrum Bitcoin wallet. It swaps which internal database object is used when fetching transaction data for history labels and address display. There is no obvious security bug introduced by the change itself.
No immediate security action required. Treat as routine code review. If reviewing further, verify that wallet.adb and wallet.db expose equivalent get_transaction semantics and that switching accessors does not bypass any consistency checks or caching behavior relevant to history display.
Security signals we found
No input validation changes
No cryptographic or authentication changes
No trust boundary changes visible in diff
No memory-unsafe operations
Change is a database accessor swap only
Evidence from the diff
The commit changes two call sites: commands.py now uses wallet.adb.get_transaction() instead of wallet.db.get_transaction() when serializing transaction inputs/outputs for the onchain_history RPC, while wallet.py now uses self.db.get_transaction() instead of self.adb.get_transaction() when resolving default labels. The stated goal is a speedup for history label generation. The change is a one-line swap in each location with no added validation, parsing, or trust boundary changes visible in the diff.
Changed components
electrum/commands.py:onchain_history()electrum/wallet.py:_get_default_label_for_txid()Inspect captured patch +2 / −2
### electrum/commands.py
@@ -1156,7 +1156,7 @@ async def onchain_history(
fx = None
for item in out:
if show_addresses:
- tx = wallet.db.get_transaction(item['txid'])
+ tx = wallet.adb.get_transaction(item['txid'])
item['inputs'] = list(map(lambda x: x.to_json(), tx.inputs()))
item['outputs'] = list(map(lambda x: {'address': x.get_ui_address_str(), 'value_sat': x.value},
tx.outputs()))
### electrum/wallet.py
@@ -1763,7 +1763,7 @@ def _get_default_label_for_txid(self, tx_hash: str) -> str:
if label := self._default_labels.get(tx_hash):
return label
labels = []
- tx = self.adb.get_transaction(tx_hash)
+ tx = self.db.get_transaction(tx_hash)
if tx:
for txin in tx.inputs():
outpoint = txin.prevout.to_str()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.