Skip to content

Conversation

@SomberNight
Copy link
Member

  • WalletDB: add more asserts to {add,get}|_verified_tx
    • to fail early before writing to and right after reading from db
  • wallet: change adb_added_verified_tx evt API, passthrough txminedinfo
    • call adb.get_tx_height(tx_hash) earlier, and pass result through subsequent events
    • add assert to sanity-check result right after it is calculated
  • WalletDB: further tighten type-check asserts

This might fix #10098 or at least give us tracebacks that are closer to the cause.

to fail early before writing to and right after reading from db

ref spesmilo#10098
- call adb.get_tx_height(tx_hash) earlier, and pass result through subsequent events
- add assert to sanity-check result right after it is calculated

ref spesmilo#10098
@SomberNight SomberNight added this to the 4.6.2 milestone Aug 4, 2025
@SomberNight SomberNight added the topic-wallet 👛 related to wallet.py, or maybe address_synchronizer.py/coinchooser.py label Aug 4, 2025
@SomberNight SomberNight marked this pull request as draft August 4, 2025 17:59
@SomberNight
Copy link
Member Author

outstanding issue:

Traceback (most recent call last):
  File "...\electrum\electrum\gui\qt\util.py", line 1492, in on_qt_callback_signal
    return func(self, *args[1:])
  File "...\electrum\electrum\gui\qt\main_window.py", line 512, in on_event_blockchain_updated
    self.refresh_tabs()
  File "...\electrum\electrum\gui\qt\main_window.py", line 1150, in refresh_tabs
    self.history_model.refresh('refresh_tabs')
  File "...\electrum\electrum\util.py", line 509, in do_profile
    o = func(*args, **kw_args)
  File "...\electrum\electrum\gui\qt\history_list.py", line 300, in refresh
    transactions = wallet.get_full_history(
  File "...\electrum\electrum\util.py", line 509, in do_profile
    o = func(*args, **kw_args)
  File "...\electrum\electrum\wallet.py", line 1517, in get_full_history
    fiat_fields = self.get_tx_item_fiat(tx_hash=txid, amount_sat=value, fx=fx, tx_fee=item['fee_sat'])
  File "...\electrum\electrum\wallet.py", line 1652, in get_tx_item_fiat
    fiat_rate = self.price_at_timestamp(tx_hash, fx.timestamp_rate)
  File "...\electrum\electrum\wallet.py", line 3197, in price_at_timestamp
    timestamp = self.adb.get_tx_height(txid).timestamp
  File "...\electrum\electrum\address_synchronizer.py", line 719, in get_tx_height
    if verified_tx_mined_info := self.db.get_verified_tx(tx_hash):  # mined and spv-ed
  File "...\electrum\electrum\json_db.py", line 65, in wrapper
    return func(self, *args, **kwargs)
  File "...\electrum\electrum\wallet_db.py", line 1507, in get_verified_tx
    assert is_hash256_str(txid), txid
AssertionError: ----

'txid': '----',

@SomberNight SomberNight modified the milestones: 4.6.2, 4.6.3 Aug 20, 2025
@ecdsa
Copy link
Member

ecdsa commented Sep 26, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic-wallet 👛 related to wallet.py, or maybe address_synchronizer.py/coinchooser.py

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeError: 'NoneType' object cannot be interpreted as an integer

2 participants