This increase the maximum number of pubkeys to 20 (valid in P2WSH and
P2SH-P2WSH) and only checks the redeemScript doesn't exceed
MAX_SCRIPT_ELEMENT_SIZE for P2SH, as this checked is removed under
Segwit context.
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
@ -231,16 +231,12 @@ CTxDestination AddAndGetMultisigDestination(const int required, const std::vecto
if((int)pubkeys.size()<required){
throwJSONRPCError(RPC_INVALID_PARAMETER,strprintf("not enough keys supplied (got %u keys, but need at least %d to redeem)", pubkeys.size(), required));
}
if(pubkeys.size()>16){
throwJSONRPCError(RPC_INVALID_PARAMETER,"Number of keys involved in the multisignature address creation > 16\nReduce the number");
if(pubkeys.size()>MAX_PUBKEYS_PER_MULTISIG){
throwJSONRPCError(RPC_INVALID_PARAMETER,strprintf("Number of keys involved in the multisignature address creation > %d\nReduce the number",MAX_PUBKEYS_PER_MULTISIG));