Skip to content

Commit 1f01fe0

Browse files
committed
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.
1 parent be99270 commit 1f01fe0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bitcoin-tx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ static void MutateTxAddOutMultiSig(CMutableTransaction& tx, const std::string& s
356356
if (vStrInputParts.size() < numkeys + 3)
357357
throw std::runtime_error("incorrect number of multisig pubkeys");
358358

359-
if (required < 1 || required > 20 || numkeys < 1 || numkeys > 20 || numkeys < required)
359+
if (required < 1 || required > MAX_PUBKEYS_PER_MULTISIG || numkeys < 1 || numkeys > MAX_PUBKEYS_PER_MULTISIG || numkeys < required)
360360
throw std::runtime_error("multisig parameter mismatch. Required " \
361361
+ std::to_string(required) + " of " + std::to_string(numkeys) + "signatures.");
362362

0 commit comments

Comments
 (0)