diff --git a/src/policy/feerate.h b/src/policy/feerate.h index fd5b581710..386ef05fbd 100644 --- a/src/policy/feerate.h +++ b/src/policy/feerate.h @@ -25,7 +25,7 @@ public: /** Fee rate of 0 satoshis per kB */ CFeeRate() : nSatoshisPerK(0) { } template - CFeeRate(const I _nSatoshisPerK): nSatoshisPerK(_nSatoshisPerK) { + explicit CFeeRate(const I _nSatoshisPerK): nSatoshisPerK(_nSatoshisPerK) { // We've previously had bugs creep in from silent double->int conversion... static_assert(std::is_integral::value, "CFeeRate should be used without floats"); } diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 569a7e89bb..d8a1e21d01 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -1207,7 +1207,7 @@ void CTxMemPool::queryHashes(std::vector& vtxid) const } static TxMempoolInfo GetInfo(CTxMemPool::indexed_transaction_set::const_iterator it) { - return TxMempoolInfo{it->GetSharedTx(), it->GetTime(), CFeeRate(it->GetFee(), it->GetTxSize()), it->GetModifiedFee() - it->GetFee()}; + return TxMempoolInfo{it->GetSharedTx(), it->GetTime(), it->GetFee(), it->GetTxSize(), it->GetModifiedFee() - it->GetFee()}; } std::vector CTxMemPool::infoAll() const diff --git a/src/txmempool.h b/src/txmempool.h index 6fa21023a8..1e1ae30ee5 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -343,8 +343,11 @@ struct TxMempoolInfo /** Time the transaction entered the mempool. */ std::chrono::seconds m_time; - /** Feerate of the transaction. */ - CFeeRate feeRate; + /** Fee of the transaction. */ + CAmount fee; + + /** Virtual size of the transaction. */ + size_t vsize; /** The fee delta. */ int64_t nFeeDelta; diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 854bb927df..1d85741912 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -2315,7 +2315,7 @@ static UniValue settxfee(const JSONRPCRequest& request) CAmount nAmount = AmountFromValue(request.params[0]); CFeeRate tx_fee_rate(nAmount, 1000); CFeeRate max_tx_fee_rate(pwallet->m_default_max_tx_fee, 1000); - if (tx_fee_rate == 0) { + if (tx_fee_rate == CFeeRate(0)) { // automatic selection } else if (tx_fee_rate < pwallet->chain().relayMinFee()) { throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("txfee cannot be less than min relay tx fee (%s)", pwallet->chain().relayMinFee().ToString()));