mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Replace CValidationState param in ProcessNewBlock with BlockChecked
This commit is contained in:
@@ -131,8 +131,7 @@ UniValue generateBlocks(boost::shared_ptr<CReserveScript> coinbaseScript, int nG
|
||||
if (pblock->nNonce == nInnerLoopCount) {
|
||||
continue;
|
||||
}
|
||||
CValidationState state;
|
||||
if (!ProcessNewBlock(state, Params(), pblock, true, NULL, NULL))
|
||||
if (!ProcessNewBlock(Params(), pblock, true, NULL, NULL))
|
||||
throw JSONRPCError(RPC_INTERNAL_ERROR, "ProcessNewBlock, block not accepted");
|
||||
++nHeight;
|
||||
blockHashes.push_back(pblock->GetHash().GetHex());
|
||||
@@ -754,10 +753,9 @@ UniValue submitblock(const JSONRPCRequest& request)
|
||||
}
|
||||
}
|
||||
|
||||
CValidationState state;
|
||||
submitblock_StateCatcher sc(block.GetHash());
|
||||
RegisterValidationInterface(&sc);
|
||||
bool fAccepted = ProcessNewBlock(state, Params(), &block, true, NULL, NULL);
|
||||
bool fAccepted = ProcessNewBlock(Params(), &block, true, NULL, NULL);
|
||||
UnregisterValidationInterface(&sc);
|
||||
if (fBlockPresent)
|
||||
{
|
||||
@@ -765,13 +763,9 @@ UniValue submitblock(const JSONRPCRequest& request)
|
||||
return "duplicate-inconclusive";
|
||||
return "duplicate";
|
||||
}
|
||||
if (fAccepted)
|
||||
{
|
||||
if (!sc.found)
|
||||
return "inconclusive";
|
||||
state = sc.state;
|
||||
}
|
||||
return BIP22ValidationResult(state);
|
||||
if (!sc.found)
|
||||
return "inconclusive";
|
||||
return BIP22ValidationResult(sc.state);
|
||||
}
|
||||
|
||||
UniValue estimatefee(const JSONRPCRequest& request)
|
||||
|
||||
Reference in New Issue
Block a user