Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/mining.cpp
Show First 20 Lines • Show All 484 Lines • ▼ Show 20 Lines | if (!request.params[0].isNull()) { | ||||
} | } | ||||
CBlockIndex *const pindexPrev = chainActive.Tip(); | CBlockIndex *const pindexPrev = chainActive.Tip(); | ||||
// TestBlockValidity only supports blocks built on the current Tip | // TestBlockValidity only supports blocks built on the current Tip | ||||
if (block.hashPrevBlock != pindexPrev->GetBlockHash()) { | if (block.hashPrevBlock != pindexPrev->GetBlockHash()) { | ||||
return "inconclusive-not-best-prevblk"; | return "inconclusive-not-best-prevblk"; | ||||
} | } | ||||
CValidationState state; | CValidationState state; | ||||
BlockValidationOptions validationOptions = | |||||
BlockValidationOptions(false, true); | |||||
TestBlockValidity(config, state, block, pindexPrev, | TestBlockValidity(config, state, block, pindexPrev, | ||||
validationOptions); | BlockValidationOptions(config) | ||||
.withCheckPoW(false) | |||||
.withCheckMerkleRoot(true)); | |||||
return BIP22ValidationResult(config, state); | return BIP22ValidationResult(config, state); | ||||
} | } | ||||
} | } | ||||
if (strMode != "template") { | if (strMode != "template") { | ||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid mode"); | throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid mode"); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 290 Lines • Show Last 20 Lines |