aboutsummaryrefslogtreecommitdiff
path: root/src/script/standard.cpp
diff options
context:
space:
mode:
authorAntoine Poinsot <darosior@protonmail.com>2021-01-05 14:14:55 +0100
committerAntoine Poinsot <darosior@protonmail.com>2021-04-28 10:00:29 +0200
commitae0429d3af6de48f6191f144dff4ad4ab672dcd6 (patch)
treed0dddac37126b0268254200e83a137230c1e8425 /src/script/standard.cpp
parent9fc68faf35c700ae955af194dd7f8c1aee85a05b (diff)
script: allow up to 20 keys in wsh() descriptors
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
Diffstat (limited to 'src/script/standard.cpp')
-rw-r--r--src/script/standard.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/script/standard.cpp b/src/script/standard.cpp
index e6f99f3034..364fac3c84 100644
--- a/src/script/standard.cpp
+++ b/src/script/standard.cpp
@@ -198,9 +198,9 @@ TxoutType Solver(const CScript& scriptPubKey, std::vector<std::vector<unsigned c
int required;
std::vector<std::vector<unsigned char>> keys;
if (MatchMultisig(scriptPubKey, required, keys)) {
- vSolutionsRet.push_back({static_cast<unsigned char>(required)}); // safe as required is in range 1..16
+ vSolutionsRet.push_back({static_cast<unsigned char>(required)}); // safe as required is in range 1..20
vSolutionsRet.insert(vSolutionsRet.end(), keys.begin(), keys.end());
- vSolutionsRet.push_back({static_cast<unsigned char>(keys.size())}); // safe as size is in range 1..16
+ vSolutionsRet.push_back({static_cast<unsigned char>(keys.size())}); // safe as size is in range 1..20
return TxoutType::MULTISIG;
}
@@ -350,10 +350,11 @@ CScript GetScriptForMultisig(int nRequired, const std::vector<CPubKey>& keys)
{
CScript script;
- script << CScript::EncodeOP_N(nRequired);
+ script << nRequired;
for (const CPubKey& key : keys)
script << ToByteVector(key);
- script << CScript::EncodeOP_N(keys.size()) << OP_CHECKMULTISIG;
+ script << keys.size() << OP_CHECKMULTISIG;
+
return script;
}