diff options
author | MarcoFalke <falke.marco@gmail.com> | 2019-09-18 13:31:59 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2019-09-23 08:00:14 -0400 |
commit | faec689bed7a5b66e2a7675853d10205b933cec8 (patch) | |
tree | b21dc3595c97b2c8018a801667701ce16ab63780 /src/txmempool.h | |
parent | faaa1f01daba94b021ca77515266a16d27f0364e (diff) |
txmempool: Make entry time type-safe (std::chrono)
Diffstat (limited to 'src/txmempool.h')
-rw-r--r-- | src/txmempool.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/txmempool.h b/src/txmempool.h index 6e5ba445d3..f2fc1c8310 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -102,7 +102,7 @@ public: const CAmount& GetFee() const { return nFee; } size_t GetTxSize() const; size_t GetTxWeight() const { return nTxWeight; } - int64_t GetTime() const { return nTime; } + std::chrono::seconds GetTime() const { return std::chrono::seconds{nTime}; } unsigned int GetHeight() const { return entryHeight; } int64_t GetSigOpCost() const { return sigOpCost; } int64_t GetModifiedFee() const { return nFee + feeDelta; } @@ -332,7 +332,7 @@ struct TxMempoolInfo CTransactionRef tx; /** Time the transaction entered the mempool. */ - int64_t nTime; + std::chrono::seconds m_time; /** Feerate of the transaction. */ CFeeRate feeRate; @@ -657,7 +657,7 @@ public: void TrimToSize(size_t sizelimit, std::vector<COutPoint>* pvNoSpendsRemaining = nullptr) EXCLUSIVE_LOCKS_REQUIRED(cs); /** Expire all transaction (and their dependencies) in the mempool older than time. Return the number of removed transactions. */ - int Expire(int64_t time) EXCLUSIVE_LOCKS_REQUIRED(cs); + int Expire(std::chrono::seconds time) EXCLUSIVE_LOCKS_REQUIRED(cs); /** * Calculate the ancestor and descendant count for the given transaction. |