mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
Remove redundant explicitly defined copy ctors
CFeeRate and CTxMemPoolEntry have explicitly defined copy ctors which has the same functionality as the implicit default copy ctors which would have been generated otherwise. Besides being redundant, it violates the rule of three (see https://en.wikipedia.org/wiki/Rule_of_three_(C%2B%2B_programming) ). (Of course, the rule of three doesn't -really- cause a resource management issue here, but the reason for that is exactly that there is no need for an explicit copy ctor in the first place since no resources are being managed). CFeeRate has an explicitly defined copy ctor which has the same functionality as the implicit default copy ctor which would h ave been generated otherwise.
This commit is contained in:
parent
7fd49d01dc
commit
b426e24678
@ -26,7 +26,6 @@ public:
|
|||||||
explicit CFeeRate(const CAmount& _nSatoshisPerK): nSatoshisPerK(_nSatoshisPerK) { }
|
explicit CFeeRate(const CAmount& _nSatoshisPerK): nSatoshisPerK(_nSatoshisPerK) { }
|
||||||
/** Constructor for a fee rate in satoshis per kB. The size in bytes must not exceed (2^63 - 1)*/
|
/** Constructor for a fee rate in satoshis per kB. The size in bytes must not exceed (2^63 - 1)*/
|
||||||
CFeeRate(const CAmount& nFeePaid, size_t nBytes);
|
CFeeRate(const CAmount& nFeePaid, size_t nBytes);
|
||||||
CFeeRate(const CFeeRate& other) { nSatoshisPerK = other.nSatoshisPerK; }
|
|
||||||
/**
|
/**
|
||||||
* Return the fee in satoshis for the given size in bytes.
|
* Return the fee in satoshis for the given size in bytes.
|
||||||
*/
|
*/
|
||||||
|
@ -39,11 +39,6 @@ CTxMemPoolEntry::CTxMemPoolEntry(const CTransactionRef& _tx, const CAmount& _nFe
|
|||||||
nSigOpCostWithAncestors = sigOpCost;
|
nSigOpCostWithAncestors = sigOpCost;
|
||||||
}
|
}
|
||||||
|
|
||||||
CTxMemPoolEntry::CTxMemPoolEntry(const CTxMemPoolEntry& other)
|
|
||||||
{
|
|
||||||
*this = other;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CTxMemPoolEntry::UpdateFeeDelta(int64_t newFeeDelta)
|
void CTxMemPoolEntry::UpdateFeeDelta(int64_t newFeeDelta)
|
||||||
{
|
{
|
||||||
nModFeesWithDescendants += newFeeDelta - feeDelta;
|
nModFeesWithDescendants += newFeeDelta - feeDelta;
|
||||||
|
@ -95,8 +95,6 @@ public:
|
|||||||
bool spendsCoinbase,
|
bool spendsCoinbase,
|
||||||
int64_t nSigOpsCost, LockPoints lp);
|
int64_t nSigOpsCost, LockPoints lp);
|
||||||
|
|
||||||
CTxMemPoolEntry(const CTxMemPoolEntry& other);
|
|
||||||
|
|
||||||
const CTransaction& GetTx() const { return *this->tx; }
|
const CTransaction& GetTx() const { return *this->tx; }
|
||||||
CTransactionRef GetSharedTx() const { return this->tx; }
|
CTransactionRef GetSharedTx() const { return this->tx; }
|
||||||
const CAmount& GetFee() const { return nFee; }
|
const CAmount& GetFee() const { return nFee; }
|
||||||
|
Loading…
Reference in New Issue
Block a user