interfaces: Add schedulerMockForward method so mockscheduler RPC can work across processes

Needed to fix new wallet_groups.py and wallet_resendwallettransactions.py tests
with multiprocess bitcoin-node executable.
This commit is contained in:
Ryan Ofsky
2022-09-08 15:21:08 -04:00
parent 924327eaf3
commit 4978754c00
6 changed files with 19 additions and 5 deletions

View File

@@ -141,7 +141,7 @@ bool LoadWallets(WalletContext& context)
}
}
void StartWallets(WalletContext& context, CScheduler& scheduler)
void StartWallets(WalletContext& context)
{
for (const std::shared_ptr<CWallet>& pwallet : GetWallets(context)) {
pwallet->postInitProcess();
@@ -149,9 +149,9 @@ void StartWallets(WalletContext& context, CScheduler& scheduler)
// Schedule periodic wallet flushes and tx rebroadcasts
if (context.args->GetBoolArg("-flushwallet", DEFAULT_FLUSHWALLET)) {
scheduler.scheduleEvery([&context] { MaybeCompactWalletDB(context); }, std::chrono::milliseconds{500});
context.scheduler->scheduleEvery([&context] { MaybeCompactWalletDB(context); }, 500ms);
}
scheduler.scheduleEvery([&context] { MaybeResendWalletTxs(context); }, 1min);
context.scheduler->scheduleEvery([&context] { MaybeResendWalletTxs(context); }, 1min);
}
void FlushWallets(WalletContext& context)