Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/blockchain.cpp
Show First 20 Lines • Show All 1,059 Lines • ▼ Show 20 Lines | if (chainHeight < config.GetChainParams().PruneAfterHeight()) { | ||||
throw JSONRPCError(RPC_MISC_ERROR, | throw JSONRPCError(RPC_MISC_ERROR, | ||||
"Blockchain is too short for pruning."); | "Blockchain is too short for pruning."); | ||||
} else if (height > chainHeight) { | } else if (height > chainHeight) { | ||||
throw JSONRPCError( | throw JSONRPCError( | ||||
RPC_INVALID_PARAMETER, | RPC_INVALID_PARAMETER, | ||||
"Blockchain is shorter than the attempted prune height."); | "Blockchain is shorter than the attempted prune height."); | ||||
} else if (height > chainHeight - MIN_BLOCKS_TO_KEEP) { | } else if (height > chainHeight - MIN_BLOCKS_TO_KEEP) { | ||||
LogPrint(BCLog::RPC, "Attempt to prune blocks close to the tip. " | LogPrint(BCLog::RPC, "Attempt to prune blocks close to the tip. " | ||||
"Retaining the minimum number of blocks."); | "Retaining the minimum number of blocks.\n"); | ||||
height = chainHeight - MIN_BLOCKS_TO_KEEP; | height = chainHeight - MIN_BLOCKS_TO_KEEP; | ||||
} | } | ||||
PruneBlockFilesManual(height); | PruneBlockFilesManual(height); | ||||
return uint64_t(height); | return uint64_t(height); | ||||
} | } | ||||
static UniValue gettxoutsetinfo(const Config &config, | static UniValue gettxoutsetinfo(const Config &config, | ||||
▲ Show 20 Lines • Show All 1,151 Lines • Show Last 20 Lines |