From 1f01fe0257b4883fc6c5893adfdcc2aa128edd71 Mon Sep 17 00:00:00 2001 From: Antoine Le Calvez Date: Sat, 13 Oct 2018 10:55:51 +0100 Subject: [PATCH] bitcoin-tx: Use constant for n pubkeys check Use the constant for the maximum number of public keys in a multisig script defined in script/script.h instead of hardcoding it. --- src/bitcoin-tx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index a3fcb8767..6d86581ac 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -356,7 +356,7 @@ static void MutateTxAddOutMultiSig(CMutableTransaction& tx, const std::string& s if (vStrInputParts.size() < numkeys + 3) throw std::runtime_error("incorrect number of multisig pubkeys"); - if (required < 1 || required > 20 || numkeys < 1 || numkeys > 20 || numkeys < required) + if (required < 1 || required > MAX_PUBKEYS_PER_MULTISIG || numkeys < 1 || numkeys > MAX_PUBKEYS_PER_MULTISIG || numkeys < required) throw std::runtime_error("multisig parameter mismatch. Required " \ + std::to_string(required) + " of " + std::to_string(numkeys) + "signatures.");