[bitcoin/bitcoin] rpc: have verifytxoutproof check the number of txns in proof structure (#13452)

sipa commented on this pull request.

> @@ -328,6 +328,10 @@ static UniValue verifytxoutproof(const JSONRPCRequest& request)
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, «Block not found in chain»);

+ if (pindex->nTx != merkleBlock.txn.GetNumTransactions()) {

Is it right to throw an RPC error here? This is more similar to being given an invalid proof (as opposed to an incorrectly formatted/unusable one), in which case Null is returned currently.

Добавить комментарий