Skip to content

Commit

Permalink
Have testproposedblock return RPC_VERIFY_ALREADY_IN_CHAIN
Browse files Browse the repository at this point in the history
Instead of RPC_VERIFY_ERROR when the block is already in the chain.
  • Loading branch information
stevenroose committed Nov 11, 2020
1 parent 88067dd commit 20475ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,7 @@ UniValue testproposedblock(const JSONRPCRequest& request)
uint256 hash = block.GetHash();
BlockMap::iterator mi = mapBlockIndex.find(hash);
if (mi != mapBlockIndex.end())
throw JSONRPCError(RPC_VERIFY_ERROR, "already have block");
throw JSONRPCError(RPC_VERIFY_ALREADY_IN_CHAIN, "already have block");

CBlockIndex* const pindexPrev = chainActive.Tip();
// TestBlockValidity only supports blocks built on the current Tip
Expand Down

0 comments on commit 20475ec

Please sign in to comment.