fixed possibility of IX getting a lack of fees

This commit is contained in:
Evan Duffield 2015-02-08 22:38:22 -07:00
parent a4c8341b98
commit 9f91d3cd9e
3 changed files with 9 additions and 6 deletions

View File

@ -52,6 +52,9 @@ bool fImporting = false;
bool fReindex = false; bool fReindex = false;
bool fBenchmark = false; bool fBenchmark = false;
bool fTxIndex = false; bool fTxIndex = false;
bool fLargeWorkForkFound = false;
bool fLargeWorkInvalidChainFound = false;
unsigned int nCoinCacheSize = 5000; unsigned int nCoinCacheSize = 5000;
/** Fees smaller than this (in satoshi) are considered zero fee (for transaction creation) */ /** Fees smaller than this (in satoshi) are considered zero fee (for transaction creation) */
@ -1775,8 +1778,6 @@ bool IsInitialBlockDownload()
chainActive.Tip()->GetBlockTime() < GetTime() - 24 * 60 * 60); chainActive.Tip()->GetBlockTime() < GetTime() - 24 * 60 * 60);
} }
bool fLargeWorkForkFound = false;
bool fLargeWorkInvalidChainFound = false;
CBlockIndex *pindexBestForkTip = NULL, *pindexBestForkBase = NULL; CBlockIndex *pindexBestForkTip = NULL, *pindexBestForkBase = NULL;
void CheckForkWarningConditions() void CheckForkWarningConditions()

View File

@ -108,7 +108,8 @@ extern int nScriptCheckThreads;
extern bool fTxIndex; extern bool fTxIndex;
extern unsigned int nCoinCacheSize; extern unsigned int nCoinCacheSize;
extern bool fManyOrphansFound; extern bool fLargeWorkForkFound;
extern bool fLargeWorkInvalidChainFound;
// Minimum disk space required - used in CheckDiskSpace() // Minimum disk space required - used in CheckDiskSpace()
static const uint64_t nMinDiskSpace = 52428800; static const uint64_t nMinDiskSpace = 52428800;

View File

@ -1847,6 +1847,7 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64_t> >& vecSend,
LOCK2(cs_main, cs_wallet); LOCK2(cs_main, cs_wallet);
{ {
nFeeRet = nTransactionFee; nFeeRet = nTransactionFee;
if(useIX && nFeeRet < CENT) nFeeRet = CENT;
while (true) while (true)
{ {
wtxNew.vin.clear(); wtxNew.vin.clear();
@ -1919,10 +1920,10 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64_t> >& vecSend,
nFeeRet = nChange; nFeeRet = nChange;
nChange = 0; nChange = 0;
wtxNew.mapValue["DS"] = "1"; wtxNew.mapValue["DS"] = "1";
} else if(useIX && nFeeRet < COIN*0.01 && nChange > ((COIN*0.01)-nFeeRet)) { } else if(useIX && nFeeRet < CENT && nChange > (CENT-nFeeRet)) {
// IX has a minimum fee of 0.01 DRK // IX has a minimum fee of 0.01 DRK
nChange -= (COIN*0.01)-nFeeRet; nChange -= CENT-nFeeRet;
nFeeRet = COIN*0.01; nFeeRet = CENT;
} }
if (nChange > 0) if (nChange > 0)