Skip to content

Commit

Permalink
[Bug] Exit early for budget submission when the wallet is locked
Browse files Browse the repository at this point in the history
When the wallet is configured for budget submission, an issue arises
where the keypool gets exhausted when the wallet is locked, causing a
crash. This prevents such behavior.
  • Loading branch information
Fuzzbawls committed Jul 28, 2024
1 parent 9bc2ee2 commit 67e632b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/budget/budgetmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ uint256 CBudgetManager::SubmitFinalBudget()
LogPrint(BCLog::MNBUDGET,"%s: Wallet not found\n", __func__);
return UINT256_ZERO;
}
// Exit if wallet is locked
if (vpwallets[0]->IsLocked()) {
LogPrint(BCLog::MNBUDGET, "%s: Wallet is locked, can't make collateral transaction.\n", __func__);
return UINT256_ZERO;
}
CReserveKey keyChange(vpwallets[0]);
if (!vpwallets[0]->CreateBudgetFeeTX(wtx, budgetHash, keyChange, BUDGET_FEE_TX)) {
LogPrint(BCLog::MNBUDGET,"%s: Can't make collateral transaction\n", __func__);
Expand Down

0 comments on commit 67e632b

Please sign in to comment.