}
int64_t nChange = nValueIn - nValue - nFeeRet;
- // 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 (wtxNew.nTime < FEE_SWITCH_TIME && !fTestNet)
- {
- if (nFeeRet < MIN_TX_FEE && nChange > 0 && nChange < CENT)
- {
- int64_t nMoveToFee = min(nChange, MIN_TX_FEE - nFeeRet);
- nChange -= nMoveToFee;
- nFeeRet += nMoveToFee;
- }
-
- // sub-cent change is moved to fee
- if (nChange > 0 && nChange < CENT)
- {
- nFeeRet += nChange;
- nChange = 0;
- }
- }
-
if (nChange > 0)
{
// Fill a vout to ourself
dPriority /= nBytes;
// Check that enough fee is included
- int64_t nPayFee = nTransactionFee * (1 + (int64_t)nBytes / 1000);
bool fAllowFree = CTransaction::AllowFree(dPriority);
-
- // Disable free transactions until 1 July 2014
- if (!fTestNet && wtxNew.nTime < FEE_SWITCH_TIME)
- {
- fAllowFree = false;
- }
-
+ int64_t nPayFee = nTransactionFee * (1 + (int64_t)nBytes / 1000);
int64_t nMinFee = wtxNew.GetMinFee(1, fAllowFree, GMF_SEND, nBytes);
if (nFeeRet < max(nPayFee, nMinFee))
{
{
LOCK(cs_wallet);
- if (block.IsProofOfWork() && mapWallet.count(block.vtx[0].GetHash()))
- {
- CWalletTx& wtx = mapWallet[block.vtx[0].GetHash()];
- printf(" mine: %d %d %" PRId64 "", wtx.GetDepthInMainChain(), wtx.GetBlocksToMaturity(), wtx.GetCredit(MINE_ALL));
- }
if (block.IsProofOfStake() && mapWallet.count(block.vtx[1].GetHash()))
{
CWalletTx& wtx = mapWallet[block.vtx[1].GetHash()];
- printf(" stake: %d %d %" PRId64 "", wtx.GetDepthInMainChain(), wtx.GetBlocksToMaturity(), wtx.GetCredit(MINE_ALL));
- }
-
+ printf(" PoS: %d %d %" PRId64 "", wtx.GetDepthInMainChain(), wtx.GetBlocksToMaturity(), wtx.GetCredit(MINE_ALL));
+ }
+ else if (mapWallet.count(block.vtx[0].GetHash()))
+ {
+ CWalletTx& wtx = mapWallet[block.vtx[0].GetHash()];
+ printf(" PoW: %d %d %" PRId64 "", wtx.GetDepthInMainChain(), wtx.GetBlocksToMaturity(), wtx.GetCredit(MINE_ALL));
+ }
}
printf("\n");
}