Skip to content

Commit

Permalink
Merge #2932: [Bug] Exit early for budget submission when the wallet i…
Browse files Browse the repository at this point in the history
…s locked

67e632b [Bug] Exit early for budget submission when the wallet is locked (Fuzzbawls)

Pull request description:

  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.

ACKs for top commit: 67e632b
  panleone:
    utACK 67e632b for making sure the wallet is unlocked before making a transaction.
  Duddino:
    ACK 67e632b
  Liquid369:
    ACK 67e632b

Tree-SHA512: 2b697793319fa64eb0806f685ab1be6a0e1e183734d5726974e16069a3442b52688436afc4b09c8488e361e036b89d5ffc5e8ab9d77ef0f97d1a79ea2321943e
  • Loading branch information
Fuzzbawls committed Aug 3, 2024
2 parents f855a9a + 67e632b commit a254b29
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 a254b29

Please sign in to comment.