mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 04:22:55 +01:00
fixed possibility of IX getting a lack of fees
This commit is contained in:
parent
a4c8341b98
commit
9f91d3cd9e
@ -52,6 +52,9 @@ bool fImporting = false;
|
||||
bool fReindex = false;
|
||||
bool fBenchmark = false;
|
||||
bool fTxIndex = false;
|
||||
bool fLargeWorkForkFound = false;
|
||||
bool fLargeWorkInvalidChainFound = false;
|
||||
|
||||
unsigned int nCoinCacheSize = 5000;
|
||||
|
||||
/** 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);
|
||||
}
|
||||
|
||||
bool fLargeWorkForkFound = false;
|
||||
bool fLargeWorkInvalidChainFound = false;
|
||||
CBlockIndex *pindexBestForkTip = NULL, *pindexBestForkBase = NULL;
|
||||
|
||||
void CheckForkWarningConditions()
|
||||
|
@ -108,7 +108,8 @@ extern int nScriptCheckThreads;
|
||||
extern bool fTxIndex;
|
||||
extern unsigned int nCoinCacheSize;
|
||||
|
||||
extern bool fManyOrphansFound;
|
||||
extern bool fLargeWorkForkFound;
|
||||
extern bool fLargeWorkInvalidChainFound;
|
||||
|
||||
// Minimum disk space required - used in CheckDiskSpace()
|
||||
static const uint64_t nMinDiskSpace = 52428800;
|
||||
|
@ -1847,6 +1847,7 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64_t> >& vecSend,
|
||||
LOCK2(cs_main, cs_wallet);
|
||||
{
|
||||
nFeeRet = nTransactionFee;
|
||||
if(useIX && nFeeRet < CENT) nFeeRet = CENT;
|
||||
while (true)
|
||||
{
|
||||
wtxNew.vin.clear();
|
||||
@ -1919,10 +1920,10 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64_t> >& vecSend,
|
||||
nFeeRet = nChange;
|
||||
nChange = 0;
|
||||
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
|
||||
nChange -= (COIN*0.01)-nFeeRet;
|
||||
nFeeRet = COIN*0.01;
|
||||
nChange -= CENT-nFeeRet;
|
||||
nFeeRet = CENT;
|
||||
}
|
||||
|
||||
if (nChange > 0)
|
||||
|
Loading…
Reference in New Issue
Block a user