You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
wallet: deferred P2MR keypool top-up is not resumed for wallets loaded at startup #284
A new P2MR wallet gets a 16-key warm pool and fills the rest of its keypool in a deferred background top-up that starts 30 s later.
If the node stops before that top-up finishes, it never resumes for wallets loaded at node startup. Their receive lookahead stays at 16, and payments to later addresses of the same seed are not seen.
Current behaviour
StartWallets schedules only plaintext PQC key validation (load.cpp#L165-L170).
An unencrypted wallet loaded through -wallet or load_on_startup therefore keeps a 16-key lookahead across every restart. It stays that way until keypoolrefill or an unloadwallet/loadwallet cycle. An encrypted wallet recovers at its first walletpassphrase.
Expected behaviour
Loading a wallet at startup should resume a pending deferred top-up, as loadwallet already does.
Steps to reproduce
Regtest, -p2mronly=1 -keypool=200:
createwallet u with load_on_startup=true. keypoolsize is 16.
Restart the node within 30 s, then wait 45 s. keypoolsize is still 16.
Import the same descriptor into another wallet and hand out index 30. Pay that address. Wallet u shows balance 0.
Run unloadwallet u and loadwallet u. The deferred top-up runs and keypoolsize becomes 200, but the balance stays 0 until rescanblockchain.
Suggested fix
Schedule the pending initial top-up from StartWallets, for example with MaybeSchedulePendingInitialKeyPoolTopUp.
The existing LoadWalletSchedulerRefillsDeferredP2MRKeypoolAcrossBatches test covers only the LoadWallet path. A matching test for LoadWallets + StartWallets would catch this.
Version
1.x.x at e374ba24cf; also v1.0.0 and v0.1.2-testnet4.
Fixed on 1.x.x by #299 (merged as dd86425), which resumes a pending deferred P2MR keypool top-up for wallets loaded at startup (30 s after load). main gets the fix when 1.x.x is integrated.
Activity
wallet: deferred P2MR keypool refill at startup and unlock; Lock() wa…
kiwidream commentedon Nov 5, 2026
Fixed on
1.x.xby #299 (merged as dd86425), which resumes a pending deferred P2MR keypool top-up for wallets loaded at startup (30 s after load).maingets the fix when1.x.xis integrated.wallet: deferred P2MR keypool refill at startup and unlock; Lock() wa…