Changeset View
Changeset View
Standalone View
Standalone View
src/script/descriptor.cpp
Show First 20 Lines • Show All 937 Lines • ▼ Show 20 Lines | if (Func("multi", expr)) { | ||||
if (providers.size() > 3) { | if (providers.size() > 3) { | ||||
error = strprintf("Cannot have %u pubkeys in bare multisig; " | error = strprintf("Cannot have %u pubkeys in bare multisig; " | ||||
"only at most 3 pubkeys", | "only at most 3 pubkeys", | ||||
providers.size()); | providers.size()); | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
} | } | ||||
if (ctx == ParseScriptContext::P2SH) { | if (ctx == ParseScriptContext::P2SH) { | ||||
if (script_size + 3 > 520) { | if (script_size + 3 > MAX_SCRIPT_ELEMENT_SIZE) { | ||||
error = strprintf("P2SH script is too large, %d bytes is " | error = strprintf("P2SH script is too large, %d bytes is " | ||||
"larger than 520 bytes", | "larger than %d bytes", | ||||
script_size + 3); | script_size + 3, MAX_SCRIPT_ELEMENT_SIZE); | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
} | } | ||||
return std::make_unique<MultisigDescriptor>(thres, | return std::make_unique<MultisigDescriptor>(thres, | ||||
std::move(providers)); | std::move(providers)); | ||||
} | } | ||||
if (ctx == ParseScriptContext::TOP && Func("sh", expr)) { | if (ctx == ParseScriptContext::TOP && Func("sh", expr)) { | ||||
auto desc = ParseScript(expr, ParseScriptContext::P2SH, out, error); | auto desc = ParseScript(expr, ParseScriptContext::P2SH, out, error); | ||||
▲ Show 20 Lines • Show All 178 Lines • Show Last 20 Lines |