Merge pull request #928 from stevenroose/already-have-block

Have testproposedblock return RPC_VERIFY_ALREADY_IN_CHAIN
This commit is contained in:
Pablo Greco 2022-11-24 12:37:34 -03:00 committed by GitHub
commit 679f620a07
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1734,7 +1734,7 @@ static RPCHelpMan testproposedblock()
uint256 hash = block.GetHash();
BlockMap::iterator mi = chainman.BlockIndex().find(hash);
if (mi != chainman.BlockIndex().end())
throw JSONRPCError(RPC_VERIFY_ERROR, "already have block");
throw JSONRPCError(RPC_VERIFY_ALREADY_IN_CHAIN, "already have block");
CBlockIndex* const pindexPrev = chainman.ActiveChain().Tip();
// TestBlockValidity only supports blocks built on the current Tip