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.
This commit is contained in:
Antoine Le Calvez 2018-10-13 10:55:51 +01:00
parent be992701b0
commit 1f01fe0257

View file

@ -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.");