Skip to content

Commit dc1e542

Browse files
committed
Merge #14474: bitcoin-tx: Use constant for n pubkeys check
1f01fe0 bitcoin-tx: Use constant for n pubkeys check (Antoine Le Calvez) Pull request description: Use the constant for the maximum number of public keys in a multisig script defined in script/script.h instead of hardcoding it. Tree-SHA512: 83e6c46df907944d0d993159955e402784415536d61fdb5a5becba2b042e37ad2a291b27301c1b169416cb71c823a571d82257512cd4a64848a27a24c875fcc6
2 parents b2863c0 + 1f01fe0 commit dc1e542

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)