Skip to content

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

Description

@TARS-bot

Crash Report

This crash report was reported through the automatic crash reporting system 🤖

Traceback

Traceback (most recent call last):
  File "app/electrum/gui/qml/util.py", line 27, in on_qt_callback_signal
  File "app/electrum/gui/qml/qetransactionlistmodel.py", line 53, in on_event_verified
  File "app/electrum/gui/qml/qetransactionlistmodel.py", line 237, in on_tx_verified
  File "app/electrum/gui/qml/qetransactionlistmodel.py", line 166, in get_section_by_timestamp
TypeError: 'NoneType' object cannot be interpreted as an integer

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

Reporter

This issue was reported by 66 user(s):

Electrum Version Python Version Operating System Wallet Type Locale Stack
4.6.0 3.10.18 (main, Jul 16 2025, 12:50:11) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 8.1.0 on samsung gtaxlwifi (M1AJQ.T580UES5CTL1) standard en_US ℹ
4.6.0 3.10.18 (main, Jul 16 2025, 12:50:11) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 10 on samsung starlte (QP1A.190711.020.G960FXXUHFVG4) standard en_US ℹ
4.6.1 3.10.18 (main, Aug 5 2025, 14:02:23) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 12 on samsung beyond1q (SP1A.210812.016.G973U1UEU9IXE1) standard en_US ℹ
4.6.1 3.10.18 (main, Aug 5 2025, 14:02:23) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 13 on ZTE P963F64 (MyOS13.0.0_A54_GEN1_MX) standard en_US ℹ
4.6.0 3.10.18 (main, Jul 16 2025, 12:50:11) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 16 on google komodo (2025080600) standard en_US ℹ
4.6.1 3.10.18 (main, Aug 5 2025, 14:02:23) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 14 on samsung dm3q (UP1A.231005.007.S918BXXS8CYBD) standard en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 13 on samsung a71 (TP1A.220624.014.A715FXXSBDXB1) standard en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 13 on samsung z3s (TP1A.220624.014.G988BXXSNHYB1) standard en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 9 on samsung dream2qltesq (PPR1.180610.011.G955USQU8DTI3) standard en_US ℹ
4.6.0 3.10.18 (main, Jul 16 2025, 12:50:11) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 14 on samsung q2q (UP1A.231005.007.F926USQS9JXKA) standard en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 16 on google cheetah (2025091000) standard en_US ℹ
4.6.2 3.10.18 (main, Aug 27 2025, 12:07:03) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 16 on google tokay (2025091000) standard en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 13 on ZTE P963F64 (MyOS13.0.0_A54_GEN1_MX) standard en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 15 on samsung b0s (AP3A.240905.015.A2.S908BXXSIFYI3) standard en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 13 on samsung a22x (TP1A.220624.014.A226BXXSBDYA1) standard,imported en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 14 on motorola penangf (UHAS34.29-27) standard en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 9 on Sony G8441 (47.2.A.11.228) standard en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 13 on Redmi eos (TP1A.220624.014) standard en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 12 on samsung d2x (SP1A.210812.016.N976BXXU7GULD) standard en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 16 on google cheetah (2025100901) standard en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 13 on Xiaomi nabu (TKQ1.221013.002 test-keys) standard en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 13 on google octopus_cheets (R142-16433.31.0 release-keys) imported en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 14 on BLU B160V (UP1A.231005.007) imported en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 16 on samsung dm1q (BP2A.250605.031.A3.S911BXXS8EYK2) 2of2 en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 16 on samsung r9s (BP2A.250605.031.A3.G990EXXSKHYK2) standard en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 15 on Redmi topaz (AQ3A.240829.003) standard en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 13 on motorola gnevan (T1THS33.75-12-6-1-4-8) standard en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 15 on Redmi topaz (AQ3A.240829.003) standard en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 16 on samsung pa3q (BP2A.250605.031.A3.S938BXXS7BYKS) standard en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 15 on Redmi topaz (AQ3A.240829.003) standard en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 16 on samsung pa3q (BP2A.250605.031.A3.S938BXXS7BYKS) standard en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 16 on samsung e3q (BP2A.250605.031.A3.S928BXXS4CYK8) 3of9 en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 13 on TECNO TECNO-KJ6 (KJ6-H897HK-T-RU-250908V1839) standard en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 15 on Redmi topaz (AQ3A.240829.003) standard en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 13 on TECNO TECNO-KJ6 (KJ6-H897HK-T-RU-250908V1839) standard en_US ℹ
4.7.0 3.11.14 (main, Jan 22 2026, 16:43:17) [Clang 12.0.9 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 15 on Redmi ocean (AP3A.240905.015.A2) standard en_US ℹ
4.7.0 3.11.14 (main, Jan 22 2026, 16:43:17) [Clang 12.0.9 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 15 on Redmi topaz (AQ3A.240829.003) standard en_US ℹ
4.7.0 3.11.14 (main, Jan 22 2026, 16:43:17) [Clang 12.0.9 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 12 on TECNO TECNO-KI5k (KI5k-F065ABCDEAgAh-S-GL-20241211V618) 2fa en_US ℹ
4.7.0 3.11.14 (main, Jan 22 2026, 16:43:17) [Clang 12.0.9 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 15 on HONOR HNVER (VER-N49 9.0.0.181(C636E8R2P2)) imported,standard en_US ℹ
4.7.1 3.11.14 (main, Feb 26 2026, 19:50:39) [Clang 12.0.9 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 16 on samsung gta9pwifi (BP2A.250605.031.A3.X210XXSAEZA7) standard en_US ℹ
4.6.2 3.10.18 (main, Aug 24 2025, 18:14:50) [Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 15 on Xiaomi plato (AP3A.240905.015.A2) standard en_US ℹ
4.7.1 3.11.14 (main, Feb 26 2026, 19:50:39) [Clang 12.0.9 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 16 on google mustang (CP1A.260305.018) standard en_US ℹ
4.7.1 3.11.14 (main, Feb 26 2026, 19:50:39) [Clang 12.0.9 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 15 on motorola lagos (VVOB35.78-71-2) standard en_US ℹ
4.7.1 3.11.14 (main, Feb 26 2026, 19:50:39) [Clang 12.0.9 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 15 on HONOR HNVER (VER-N49 9.0.0.181(C636E8R2P2)) imported en_US ℹ
4.7.1 3.11.14 (main, Feb 26 2026, 19:50:39) [Clang 12.0.9 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 15 on Redmi topaz (AQ3A.240829.003) standard en_US ℹ
1.1.0 3.10.18 (main, Feb 19 2026, 11:24:57) [Clang 12.0.9 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 16 on samsung a26x (BP2A.250605.031.A3.A266BXXS8BZB6) standard en_US ℹ
4.7.0 3.11.14 (main, Jan 22 2026, 16:43:17) [Clang 12.0.9 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 9 on OnePlus OP516FL1 (NE2211_11_C.22) standard en_US ℹ
4.7.2 3.11.14 (main, Apr 1 2026, 15:46:40) [Clang 12.0.9 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 16 on samsung pa3q (BP2A.250605.031.A3.S938BXXS9BZCH) standard en_US ℹ
4.7.2 3.11.14 (main, Apr 1 2026, 15:46:40) [Clang 12.0.9 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 15 on Redmi topaz (AQ3A.240829.003) standard en_US ℹ
4.7.2 3.11.14 (main, Apr 1 2026, 15:46:40) [Clang 12.0.9 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 15 on Redmi topaz (AQ3A.240829.003) standard en_US ℹ
4.7.2 3.11.14 (main, Apr 1 2026, 15:46:40) [Clang 12.0.9 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 15 on motorola lagos (VVOBS35.78-158-2) standard en_US ℹ
4.7.2 3.11.14 (main, Apr 1 2026, 15:46:40) [Clang 12.0.9 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 15 on Redmi topaz (AQ3A.240829.003) standard en_US ℹ
4.7.2 3.11.14 (main, Apr 1 2026, 15:46:40) [Clang 12.0.9 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 10 on HUAWEI HWCLT (CLT-L29 10.0.0.171(C782E6R1P3)) standard en_US ℹ
4.7.2 3.11.14 (main, Apr 1 2026, 15:46:40) [Clang 12.0.9 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 15 on HONOR HNVER (VER-N49 9.0.0.181(C636E8R2P2)) imported,standard en_US ℹ
4.7.2 3.11.14 (main, Apr 1 2026, 15:46:40) [Clang 12.0.9 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 16 on samsung m3q (BP4A.251205.006.S948USQS2AZCO) standard en_US ℹ
4.7.2 3.11.14 (main, Apr 1 2026, 15:46:40) [Clang 12.0.9 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 16 on google tegu (2026060601) standard en_US ℹ
4.7.0 3.11.14 (main, Jan 22 2026, 16:43:17) [Clang 12.0.9 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 16 on samsung r11q (BP4A.251205.006.S711USQS8FZF2) imported en_US ℹ
4.8.0 3.11.15 (main, Jul 8 2026, 11:26:29) [Clang 19.0.1 (https://android.googlesource.com/toolchain/llvm-project 97a699bf4 Android 16 on samsung pa3q (BP4A.251205.006.S938BXXSBCZG3) standard en_US ℹ
4.8.0 3.11.15 (main, Jul 8 2026, 11:26:29) [Clang 19.0.1 (https://android.googlesource.com/toolchain/llvm-project 97a699bf4 Android 16 on samsung r11q (BP4A.251205.006.S711USQS8FZG1) standard,imported en_US ℹ
4.8.1 3.11.15 (main, Aug 10 2026, 16:01:42) [Clang 19.0.1 (https://android.googlesource.com/toolchain/llvm-project 97a699bf4 Android 14 on samsung a13ve (UP1A.231005.007.A137FXXSCEZB1) imported en_US ℹ
4.8.1 3.11.15 (main, Aug 10 2026, 16:01:42) [Clang 19.0.1 (https://android.googlesource.com/toolchain/llvm-project 97a699bf4 Android 11 on xiaomi willow (RKQ1.201004.002 test-keys) standard en_US ℹ
4.8.0 3.11.15 (main, Jul 8 2026, 11:26:29) [Clang 19.0.1 (https://android.googlesource.com/toolchain/llvm-project 97a699bf4 Android 10 on samsung star2lte (QP1A.190711.020.G965FXXUHFVG4) standard en_US ℹ
4.8.1 3.11.15 (main, Aug 10 2026, 16:01:42) [Clang 19.0.1 (https://android.googlesource.com/toolchain/llvm-project 97a699bf4 Android 16 on HONOR HNVER (VER-N49 10.0.0.155(C636E4R2P3)) imported en_US ℹ
4.7.2 3.11.14 (main, Apr 1 2026, 15:46:40) [Clang 12.0.9 (https://android.googlesource.com/toolchain/llvm-project c935d99d7 Android 16 on samsung m3q (BP4A.251205.006.S948BXXS4AZHL) standard en_US ℹ
4.8.1 3.11.15 (main, Aug 10 2026, 16:01:42) [Clang 19.0.1 (https://android.googlesource.com/toolchain/llvm-project 97a699bf4 Android 13 on samsung x1s (TP1A.220624.014.G981BXXSNHYB1) standard en_US ℹ
4.8.1 3.11.15 (main, Aug 10 2026, 16:01:42) [Clang 19.0.1 (https://android.googlesource.com/toolchain/llvm-project 97a699bf4 Android 17 on google stallion (2026100201) 2of4 en_US ℹ

Additional Information

Opened app from app switcher


Started the app with 2 new unconfirmed tx


TypeError:'NoneType object cannot be interpreted as an integer


Not sure just cancelled transaction and it crashed?


Activity

  1. self-assigned this
    on Aug 4, 2025
  2. SomberNight commented on Aug 4, 2025

    @SomberNight
    Member

    The cause is likely 197933d.
    SPV finishes before we receive the full tx.
    (we should add a test case for this)

  3. added this to the 4.6.2 milestone on Aug 4, 2025
  4. SomberNight commented on Aug 15, 2025

    @SomberNight
    Member
  5. modified the milestones: 4.6.2, 4.6.3 on Aug 20, 2025
  6. modified the milestones: 4.7.0, 4.8.0 on Jan 5, 2026
  7. modified the milestones: 4.8.0, 4.9.0 on Jun 29, 2026
  8. devdavidejesus commented on Oct 9, 2026

    @devdavidejesus
    Contributor

    I could reproduce this on master (89dda29) with a unit test, following your note about 197933d: an unsigned (partial) tx saved as local, e.g. by the txbatcher, gets mined, and SPV finishes before we download the signed tx. adb.get_tx_height() then returns LOCAL (no timestamp, conf=0), wallet.on_event_adb_added_verified_tx sends that with the verified event, and QETransactionListModel.on_tx_verified() fails with the traceback from this issue.

    test (tests/qml/test_qml_txlist_verified.py)
    import gc
    
    from electrum import SimpleConfig
    from electrum.address_synchronizer import TX_HEIGHT_UNCONFIRMED
    from electrum.bitcoin import address_to_script
    from electrum.fee_policy import FixedFeePolicy
    from electrum.gui.qml.qetransactionlistmodel import QETransactionListModel
    from electrum.transaction import PartialTxOutput, Transaction
    from electrum.util import TxMinedInfo
    
    from .. import ElectrumTestCase, restore_wallet_from_text__for_unittest
    
    
    class TestTxListVerifiedEvent(ElectrumTestCase):
        TESTNET = True
    
        @classmethod
        def setUpClass(cls):
            super().setUpClass()
            # free the QObjects (and the wallets they hold) before other tests check for lingering wallets
            cls.addClassCleanup(gc.collect)
    
        async def test_tx_verified_before_we_have_the_signed_tx(self):
            # see #10098
            config = SimpleConfig({'electrum_path': self.electrum_path})
            wallet = restore_wallet_from_text__for_unittest(
                'bitter grass shiver impose acquire brush forget axis eager alone wine silver', path=None, config=config)['wallet']
            addr1, addr2 = wallet.get_receiving_addresses()[:2]
            spk = address_to_script(addr1)
            funding_tx = Transaction(
                '02000000' + '01' + '11' * 32 + '00000000' + '00' + 'fdffffff'
                + '01' + (100_000).to_bytes(8, 'little').hex() + bytes([len(spk)]).hex() + spk.hex()
                + '00000000')
            wallet.adb.receive_tx_callback(funding_tx, tx_height=TX_HEIGHT_UNCONFIRMED)
            # an unsigned tx saved as local, e.g. by the txbatcher before signing it
            tx = wallet.make_unsigned_transaction(
                outputs=[PartialTxOutput.from_address_and_value(addr2, 50_000)], fee_policy=FixedFeePolicy(1000))
            txid = tx.txid()
            self.assertTrue(wallet.adb.add_transaction(tx))
            model = QETransactionListModel(wallet)
            # deliver the 'verified' event below ourselves: an exception in a Qt slot would abort the test run
            model.unregister_callbacks()
            # the signed tx got mined, and SPV finishes before we download it
            wallet.adb.receive_history_callback(addr2, [(txid, 100)], {})
            wallet.adb.add_verified_tx(txid, TxMinedInfo(_height=100, conf=1, timestamp=1700000000, txpos=1, header_hash='00' * 32))
            info = wallet.adb.get_tx_height(txid)  # what wallet.on_event_adb_added_verified_tx sends
            self.assertIsNone(info.timestamp)
            model.on_tx_verified(txid, info)
            item = model.tx_history[model._tx_positions[txid]]
            self.assertEqual('local', item['section'])
            self.assertIsNone(item['timestamp'])

    From reading #10107: with its new assert in add_verified_tx (info2.conf > 0), this case would fail there instead, since get_tx_height() returns conf=0 for it.

    I have a small fix on the QML side: on_tx_verified() handles a missing timestamp the same way tx_to_model() does (section local/mempool, status text from wallet.get_tx_status()), with this test. Would you like a PR for that, or would you rather handle this case in the adb / in #10107?

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

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions