X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fwallet.cpp;h=3906f27850aea82133d55bb1c6d2ba96d51a73a1;hb=c8a7f72c867da909f4a4dd1d1e1c028ba8547590;hp=5990978f968ea65e796b768ea5aaa9615ff1c566;hpb=5ed0a2b839d4654c252e63b86352c7b1bcbb69ab;p=novacoin.git diff --git a/src/wallet.cpp b/src/wallet.cpp index 5990978..3906f27 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -115,7 +115,7 @@ bool CWallet::AddCScript(const CScript& redeemScript) bool CWallet::LoadCScript(const CScript& redeemScript) { - /* A sanity check was added in pull #3843 to avoid adding redeemScripts + /* A sanity check was added in commit 5ed0a2b to avoid adding redeemScripts * that never can be redeemed. However, old wallets may still contain * these. Do not add them to the wallet and warn. */ if (redeemScript.size() > MAX_SCRIPT_ELEMENT_SIZE) @@ -1542,26 +1542,6 @@ bool CWallet::CreateTransaction(const vector >& vecSend, } 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 @@ -1613,15 +1593,8 @@ bool CWallet::CreateTransaction(const vector >& vecSend, 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)) @@ -2236,17 +2209,16 @@ void CWallet::PrintWallet(const CBlock& block) { { 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"); }