diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp --- a/src/policy/fees.cpp +++ b/src/policy/fees.cpp @@ -460,14 +460,14 @@ // It's not possible to get reasonable estimates for confTarget of 1 if (confTarget <= 1 || (unsigned int)confTarget > feeStats.GetMaxConfirms()) { - return CFeeRate(0); + return CFeeRate(Amount(0)); } double median = feeStats.EstimateMedianVal( confTarget, SUFFICIENT_FEETXS, MIN_SUCCESS_PCT, true, nBestSeenHeight); if (median < 0) { - return CFeeRate(0); + return CFeeRate(Amount(0)); } return CFeeRate(Amount(int64_t(median))); @@ -482,7 +482,7 @@ // Return failure if trying to analyze a target we're not tracking if (confTarget <= 0 || (unsigned int)confTarget > feeStats.GetMaxConfirms()) { - return CFeeRate(0); + return CFeeRate(Amount(0)); } // It's not possible to get reasonable estimates for confTarget of 1 @@ -508,12 +508,12 @@ pool.GetMinFee(GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000) .GetFeePerK(); - if (minPoolFee > 0 && minPoolFee > int64_t(median)) { + if (minPoolFee > Amount(0) && minPoolFee > Amount(int64_t(median))) { return CFeeRate(minPoolFee); } if (median < 0) { - return CFeeRate(0); + return CFeeRate(Amount(0)); } return CFeeRate(Amount(int64_t(median))); @@ -535,7 +535,7 @@ pool.GetMinFee(GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000) .GetFeePerK(); - if (minPoolFee > 0) { + if (minPoolFee > Amount(0)) { return double(INF_PRIORITY.GetSatoshis()); } diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -141,11 +141,11 @@ } void SetNull() { - nValue = -1; + nValue = Amount(-1); scriptPubKey.clear(); } - bool IsNull() const { return (nValue == -1); } + bool IsNull() const { return (nValue == Amount(-1)); } Amount GetDustThreshold(const CFeeRate &minRelayTxFee) const { // "Dust" is defined in terms of CTransaction::minRelayTxFee, which has @@ -157,7 +157,7 @@ // txout is 31 bytes big, and will need a CTxIn of at least 67 bytes to // spend: so dust is a spendable txout less than 294*minRelayTxFee/1000 // (in satoshis). - if (scriptPubKey.IsUnspendable()) return 0; + if (scriptPubKey.IsUnspendable()) return Amount(0); size_t nSize = GetSerializeSize(*this, SER_DISK, 0); diff --git a/src/primitives/transaction.cpp b/src/primitives/transaction.cpp --- a/src/primitives/transaction.cpp +++ b/src/primitives/transaction.cpp @@ -85,7 +85,7 @@ nLockTime(tx.nLockTime), hash(ComputeHash()) {} Amount CTransaction::GetValueOut() const { - Amount nValueOut = 0; + Amount nValueOut(0); for (std::vector::const_iterator it(vout.begin()); it != vout.end(); ++it) { nValueOut += it->nValue; diff --git a/src/script/sign.cpp b/src/script/sign.cpp --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -203,8 +203,8 @@ assert(txin.prevout.n < txFrom.vout.size()); const CTxOut &txout = txFrom.vout[txin.prevout.n]; - return SignSignature(keystore, txout.scriptPubKey, txTo, nIn, - txout.nValue.GetSatoshis(), nHashType); + return SignSignature(keystore, txout.scriptPubKey, txTo, nIn, txout.nValue, + nHashType); } static std::vector CombineMultisig(