Litecoin: improve dust spamming prevention algorithm to add base fee for each output that's less than a CENT

This commit is contained in:
coblee 2011-11-21 13:43:41 -10:00 committed by Warren Togami
parent 5e17fcb020
commit db4d8e21d9

View File

@ -616,13 +616,11 @@ int64 CTransaction::GetMinFee(unsigned int nBlockSize, bool fAllowFree,
} }
} }
// To limit dust spam, require base fee if any output is less than 0.01 // Litecoin
if (nMinFee < nBaseFee) // To limit dust spam, add nBaseFee for each output less than 0.01
{ BOOST_FOREACH(const CTxOut& txout, vout)
BOOST_FOREACH(const CTxOut& txout, vout) if (txout.nValue < 0.01)
if (txout.nValue < CENT) nMinFee += nBaseFee;
nMinFee = nBaseFee;
}
// Raise the price as the block approaches full // Raise the price as the block approaches full
if (nBlockSize != 1 && nNewBlockSize >= MAX_BLOCK_SIZE_GEN/2) if (nBlockSize != 1 && nNewBlockSize >= MAX_BLOCK_SIZE_GEN/2)