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: qbit-qt unlock does not run the keypool top-up that walletpassphrase now runs (#299 follow-up) #355
With #299, walletpassphrase calls the new TopUpKeyPoolAfterUnlock(). That function tops up the non-P2MR active keypools inline, and schedules a background refill of any P2MR receive or change pool that is not full. The qbit-qt unlock does not do this. interfaces::Wallet::unlock only schedules a pending create-time top-up, so GUI and RPC unlocks leave the wallet in different states.
Observed
At #299's head ae4045b2e7, which is not merged yet. Found while reviewing the #299 work, from the code; not reproduced in the GUI.
interfaces::Wallet::unlock (src/wallet/interfaces.cpp:163-170) calls Unlock(pass, false), then only MaybeSchedulePendingInitialKeyPoolTopUp.
After a GUI unlock, a partly used P2MR pool that is still above its low watermark is not refilled until a later address request crosses the watermark. Hardened non-P2MR descriptors, which can only be topped up while the wallet is unlocked, are not topped up at all.
Impact
Low. A GUI user can run out of hardened non-P2MR keys while the wallet is locked sooner than an RPC user would. Payments to addresses beyond the current lookahead are also detected later. No funds are lost.
Suggested fix
Call TopUpKeyPoolAfterUnlock() from interfaces::Wallet::unlock once Unlock() has returned, outside cs_wallet, so both unlock paths share it. Confirm it does not block the GUI thread: the non-P2MR top-up is fast and the P2MR refill is scheduled. Add a test next to #299's WalletPassphrase* cases.
Activity