Skip to content

Commit

Permalink
Set a maximum rollback height
Browse files Browse the repository at this point in the history
  • Loading branch information
panleone committed Apr 26, 2023
1 parent 91915ea commit 859ae93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ UniValue invalidateblock(const JSONRPCRequest& request)
if (request.fHelp || request.params.size() != 1)
throw std::runtime_error(
"invalidateblock \"blockhash\"\n"
"\nPermanently marks a block as invalid, as if it violated a consensus rule.\n"
"\nPermanently marks a block as invalid, as if it violated a consensus rule. Note: Your oldest sapling note must not be more than 43200 blocks behind the chain tip\n"

"\nArguments:\n"
"1. blockhash (string, required) the hash of the block to mark as invalid\n"
Expand All @@ -1234,7 +1234,7 @@ UniValue invalidateblock(const JSONRPCRequest& request)
//Do we need to recreate the witnesscache or is the current one enough?
if (pwallet->GetSaplingScriptPubKeyMan()->nWitnessCacheSize <= (chainActive.Height() - pblockindex->nHeight + 1)) {
if (!pwallet->GetSaplingScriptPubKeyMan()->BuildWitnessChain(pblockindex)) {
throw JSONRPCError(RPC_DATABASE_ERROR, "Cannot load default note values");
throw JSONRPCError(RPC_DATABASE_ERROR, "Sapling notes are too old!");
}
}
}
Expand Down

0 comments on commit 859ae93

Please sign in to comment.