if (txNew.vout.size() == 2 && ((pcoin.first->vout[pcoin.second].scriptPubKey == scriptPubKeyKernel || pcoin.first->vout[pcoin.second].scriptPubKey == txNew.vout[1].scriptPubKey))
&& pcoin.first->GetHash() != txNew.vin[0].prevout.hash)
{
+ // Stop adding more inputs if already too many inputs
+ if (txNew.vin.size() >= 100)
+ break;
// Stop adding more inputs if value is already pretty significant
if (nCredit > nCombineThreshold)
break;
// Limit size
unsigned int nBytes = ::GetSerializeSize(txNew, SER_NETWORK, PROTOCOL_VERSION);
if (nBytes >= MAX_BLOCK_SIZE_GEN/5)
- return false;
+ return error("CreateCoinStake : exceeded coinstake size limit");
// Check enough fee is paid
if (nMinFee < txNew.GetMinFee() - MIN_TX_FEE)