pubkeys[i].SetPubKey(vchPubKey);
}
- if((required == 0) || (required > pubkeys.size()))
+ if(pubkeys.size() > 16)
+ {
+ QMessageBox::warning(this, tr("Error"), tr("Number of addresses involved in the address creation > %1\nReduce the number").arg(16), QMessageBox::Ok);
+ return;
+ }
+
+ if(required == 0)
+ {
+ QMessageBox::warning(this, tr("Error"), tr("Number of required signatures is 0\nNumber of required signatures must be between 1 and number of keys involved in the creation of address."), QMessageBox::Ok);
return;
+ }
+ if(required > pubkeys.size())
+ {
+ QMessageBox::warning(this, tr("Error"), tr("Number of required signatures > Number of keys involved in the creation of address."), QMessageBox::Ok);
+ return;
+ }
+
CScript script;
script.SetMultisig(required, pubkeys);
+ if (script.size() > MAX_SCRIPT_ELEMENT_SIZE)
+ {
+ QMessageBox::warning(this, tr("Error"), tr("Redeem script exceeds size limit: %1 > %2\nReduce the number of addresses involved in the address creation.").arg(script.size()).arg(MAX_SCRIPT_ELEMENT_SIZE), QMessageBox::Ok);
+ return;
+ }
CScriptID scriptID = script.GetID();
CBitcoinAddress address(scriptID);
// Fetch previous transactions (inputs)
std::map<COutPoint, CScript> mapPrevOut;
- for(int i = 0; i < mergedTx.vin.size(); i++)
+ for(unsigned int i = 0; i < mergedTx.vin.size(); i++)
{
CTransaction tempTx;
MapPrevTx mapPrevTx;
// Sign what we can
bool fComplete = true;
- for(int i = 0; i < mergedTx.vin.size(); i++)
+ for(unsigned int i = 0; i < mergedTx.vin.size(); i++)
{
CTxIn& txin = mergedTx.vin[i];
if(mapPrevOut.count(txin.prevout) == 0)