Skip to content

Commit

Permalink
bitcoin-tx: Use constant for n pubkeys check
Browse files Browse the repository at this point in the history
Use the constant for the maximum number of public keys in a multisig
script defined in script/script.h instead of hardcoding it.
  • Loading branch information
alecalve committed Oct 13, 2018
1 parent be99270 commit 1f01fe0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bitcoin-tx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.");

Expand Down

0 comments on commit 1f01fe0

Please sign in to comment.