Skip to content
Browse files

Create COIN_DUST constant, to represent the dust spam limit used

  • Loading branch information...
1 parent 5fe3f46 commit fea684d3b1a6c5c23a37c9e2b90fc65c9d421608 Jeff Garzik committed with Jeff Garzik
Showing with 3 additions and 2 deletions.
  1. +1 −1 src/main.cpp
  2. +1 −0 src/util.h
  3. +1 −1 src/wallet.cpp
View
2 src/main.cpp
@@ -605,7 +605,7 @@ int64 CTransaction::GetMinFee(unsigned int nBlockSize, bool fAllowFree,
if (nMinFee < nBaseFee)
{
BOOST_FOREACH(const CTxOut& txout, vout)
- if (txout.nValue < CENT)
+ if (txout.nValue < COIN_DUST)
nMinFee = nBaseFee;
}
View
1 src/util.h
@@ -34,6 +34,7 @@ typedef unsigned long long uint64;
static const int64 COIN = 100000000;
static const int64 CENT = 1000000;
+static const int64 COIN_DUST = CENT; // 1000000, or 0.01 BTC
#define loop for (;;)
#define BEGIN(a) ((char*)&(a))
View
2 src/wallet.cpp
@@ -1161,7 +1161,7 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64> >& vecSend, CW
// if sub-cent change is required, the fee must be raised to at least MIN_TX_FEE
// or until nChange becomes zero
// NOTE: this depends on the exact behaviour of GetMinFee
- if (nFeeRet < MIN_TX_FEE && nChange > 0 && nChange < CENT)
+ if (nFeeRet < MIN_TX_FEE && nChange > 0 && nChange < COIN_DUST)
{
int64 nMoveToFee = min(nChange, MIN_TX_FEE - nFeeRet);
nChange -= nMoveToFee;

0 comments on commit fea684d

Please sign in to comment.
Something went wrong with that request. Please try again.