diff options
author | Matt Corallo <git@bluematt.me> | 2016-10-27 16:30:17 -0400 |
---|---|---|
committer | Matt Corallo <git@bluematt.me> | 2016-11-09 11:21:55 -0800 |
commit | ae223576077448bd4ec250c73f5d8fe5e9a9ac7d (patch) | |
tree | 8b894f61a09b10dc25d987e695bd9ee85523312b /src/rpc/mining.cpp | |
parent | 7c98ce584ec23bcddcba8cdb33efa6547212f6ef (diff) |
Replace CValidationState param in ProcessNewBlock with BlockChecked
Diffstat (limited to 'src/rpc/mining.cpp')
-rw-r--r-- | src/rpc/mining.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index d9fe9530a1..ad545bdf0d 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -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) |