|
|
@ -1003,6 +1003,7 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64> >& vecSend, CW |
|
|
|
int64 nChange = nValueIn - nValue - nFeeRet; |
|
|
|
int64 nChange = nValueIn - nValue - nFeeRet; |
|
|
|
// if sub-cent change is required, the fee must be raised to at least MIN_TX_FEE
|
|
|
|
// if sub-cent change is required, the fee must be raised to at least MIN_TX_FEE
|
|
|
|
// or until nChange becomes zero
|
|
|
|
// 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 < CENT) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int64 nMoveToFee = min(nChange, MIN_TX_FEE - nFeeRet); |
|
|
|
int64 nMoveToFee = min(nChange, MIN_TX_FEE - nFeeRet); |
|
|
@ -1055,7 +1056,7 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64> >& vecSend, CW |
|
|
|
// Check that enough fee is included
|
|
|
|
// Check that enough fee is included
|
|
|
|
int64 nPayFee = nTransactionFee * (1 + (int64)nBytes / 1000); |
|
|
|
int64 nPayFee = nTransactionFee * (1 + (int64)nBytes / 1000); |
|
|
|
bool fAllowFree = CTransaction::AllowFree(dPriority); |
|
|
|
bool fAllowFree = CTransaction::AllowFree(dPriority); |
|
|
|
int64 nMinFee = wtxNew.GetMinFee(1, fAllowFree); |
|
|
|
int64 nMinFee = wtxNew.GetMinFee(1, fAllowFree, GMF_SEND); |
|
|
|
if (nFeeRet < max(nPayFee, nMinFee)) |
|
|
|
if (nFeeRet < max(nPayFee, nMinFee)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
nFeeRet = max(nPayFee, nMinFee); |
|
|
|
nFeeRet = max(nPayFee, nMinFee); |
|
|
|