mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-24 13:59:38 +02:00
ae22357Replace CValidationState param in ProcessNewBlock with BlockChecked (Matt Corallo)7c98ce5Remove pfrom parameter from ProcessNewBlock (Matt Corallo)e2e069dRevert "RPC: Give more details when "generate" fails" (Matt Corallo)
This commit is contained in:
@@ -131,9 +131,8 @@ UniValue generateBlocks(boost::shared_ptr<CReserveScript> coinbaseScript, int nG
|
||||
if (pblock->nNonce == nInnerLoopCount) {
|
||||
continue;
|
||||
}
|
||||
CValidationState state;
|
||||
if (!ProcessNewBlock(state, Params(), NULL, pblock, true, NULL, false))
|
||||
throw JSONRPCError(RPC_INTERNAL_ERROR, strprintf("ProcessNewBlock: block not accepted: %s", FormatStateMessage(state)));
|
||||
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(), NULL, &block, true, NULL, false);
|
||||
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