aboutsummaryrefslogtreecommitdiff
path: root/src/rpcmisc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpcmisc.cpp')
-rw-r--r--src/rpcmisc.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp
index 6964b97be3..2564a3f1a6 100644
--- a/src/rpcmisc.cpp
+++ b/src/rpcmisc.cpp
@@ -176,7 +176,7 @@ Value validateaddress(const Array& params, bool fHelp)
//
// Used by addmultisigaddress / createmultisig:
//
-CScript _createmultisig(const Array& params)
+CScript _createmultisig_redeemScript(const Array& params)
{
int nRequired = params[0].get_int();
const Array& keys = params[1].get_array();
@@ -228,6 +228,11 @@ CScript _createmultisig(const Array& params)
}
CScript result;
result.SetMultisig(nRequired, pubkeys);
+
+ if (result.size() > MAX_SCRIPT_ELEMENT_SIZE)
+ throw runtime_error(
+ strprintf("redeemScript exceeds size limit: %d > %d", result.size(), MAX_SCRIPT_ELEMENT_SIZE));
+
return result;
}
@@ -263,7 +268,7 @@ Value createmultisig(const Array& params, bool fHelp)
}
// Construct using pay-to-script-hash:
- CScript inner = _createmultisig(params);
+ CScript inner = _createmultisig_redeemScript(params);
CScriptID innerID = inner.GetID();
CBitcoinAddress address(innerID);