From 9be0e6837b878f72bd087ce32b7a2f2ffb2fd544 Mon Sep 17 00:00:00 2001 From: Suhas Daftuar Date: Thu, 9 Apr 2015 13:21:11 -0400 Subject: Be stricter in processing unrequested blocks AcceptBlock will no longer process an unrequested block, unless it has not been previously processed and has more work than chainActive.Tip() --- src/rpcmining.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/rpcmining.cpp') diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index d58d43857..528d5406f 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -164,7 +164,7 @@ Value generate(const Array& params, bool fHelp) ++pblock->nNonce; } CValidationState state; - if (!ProcessNewBlock(state, NULL, pblock)) + if (!ProcessNewBlock(state, NULL, pblock, true, NULL)) throw JSONRPCError(RPC_INTERNAL_ERROR, "ProcessNewBlock, block not accepted"); ++nHeight; blockHashes.push_back(pblock->GetHash().GetHex()); @@ -650,7 +650,7 @@ Value submitblock(const Array& params, bool fHelp) CValidationState state; submitblock_StateCatcher sc(block.GetHash()); RegisterValidationInterface(&sc); - bool fAccepted = ProcessNewBlock(state, NULL, &block); + bool fAccepted = ProcessNewBlock(state, NULL, &block, true, NULL); UnregisterValidationInterface(&sc); if (fBlockPresent) { -- cgit v1.2.3