Fix staking crash with large wallets + add -zapwallettxes
- ThreadStakeMiner: catch-and-retry instead of crash on exception (boost::bad_weak_ptr no longer kills the daemon) - GetStakeWeight: take wallet lock once instead of per-coin to reduce lock contention with 20K+ transaction wallets - StakeMiner: continue instead of exit when CreateNewBlock fails - Wrap all NotifyTransactionChanged/NotifyAddressBookChanged signal emissions in try/catch to absorb stale slot exceptions - Add -zapwallettxes flag: strips all tx records from wallet.dat keeping only keys, then rescans blockchain to rebuild history Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+4
-1
@@ -434,7 +434,10 @@ void StakeMiner(CWallet *pwallet)
|
||||
int64_t nFees;
|
||||
unique_ptr<CBlock> pblock(CreateNewBlock(pwallet, true, &nFees));
|
||||
if (!pblock.get())
|
||||
return;
|
||||
{
|
||||
MilliSleep(5000);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Try to sign the block
|
||||
if (pblock->SignBlock(*pwallet, nFees))
|
||||
|
||||
Reference in New Issue
Block a user