Files
purple-electrumwallet/electrum
SomberNight 45458c2f89 wallet_db: put 'genesis_blockhash' in DB, detect mainnet/testnet mixup
If the user tries to open a wallet for a different chain (mainnet vs testnet), try to show a reasonable error message.

See previous attempt at this: https://github.com/spesmilo/electrum/commit/c13e05770150c5210783c3d42d3d2b1a683f18b4, which added `wallet.test_addresses_sanity()`. However there are many codepaths where "random" exceptions might get raised before the Wallet object is even instantiated.
See [discussion there](https://github.com/spesmilo/electrum/commit/c13e05770150c5210783c3d42d3d2b1a683f18b4#commitcomment-28017341):
> should we actually fix that?
> if yes, it would be better to write the network type in storage

Indeed now I think we should do that. At the time I was concerned it would not help against altcoin forks if we put "mainnet" or "testnet" in the DB. Now I realise we should just put the genesis block hash in the DB instead.

Many of the reports in https://github.com/spesmilo/electrum/issues/6526 are likely due to users trying to open a mainnet wallet in testnet mode or vice-versa.

fixes https://github.com/spesmilo/electrum/issues/9134
    same issue in wizard 2fa two-step wallet-creation flow
2026-04-20 01:39:35 +00:00
..
2026-02-21 03:51:52 +00:00
2026-02-17 18:11:13 +00:00
2026-03-20 17:43:12 +00:00
2026-03-20 18:12:55 +00:00
2026-01-28 17:49:36 +01:00
2026-04-02 14:46:50 +02:00
2026-03-20 18:12:55 +00:00
2026-03-20 18:14:38 +00:00
2026-03-27 13:15:07 +00:00
2026-03-20 18:14:38 +00:00