 |
PRCYCoin
2.0.0.7rc1
P2P Digital Currency
|
Go to the documentation of this file.
8 #ifndef BITCOIN_TXMEMPOOL_H
9 #define BITCOIN_TXMEMPOOL_H
23 return COIN * 1440 / 250;
35 static const unsigned int MEMPOOL_HEIGHT = 0x7FFFFFFF;
57 double GetPriority(
unsigned int currentHeight)
const;
84 bool IsNull()
const {
return (
ptx == NULL &&
n == (uint32_t)-1); }
136 std::map<uint256, CTxMemPoolEntry>
mapTx;
138 std::map<uint256, std::pair<double, CAmount> >
mapDeltas;
153 void remove(
const CTransaction& tx, std::list<CTransaction>& removed,
bool fRecursive =
false);
156 void removeForBlock(
const std::vector<CTransaction>& vtx,
unsigned int nBlockHeight, std::list<CTransaction>& conflicts);
182 return (
mapTx.count(hash) != 0);
213 #endif // BITCOIN_TXMEMPOOL_H
bool GetCoins(const uint256 &txid, CCoins &coins) const
Retrieve the CCoins (unspent transaction outputs) for a given txid.
void AddTransactionsUpdated(unsigned int n)
void pruneSpent(const uint256 &hash, CCoins &coins)
unsigned int GetHeight() const
void removeCoinbaseSpends(const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight)
bool AllowFree(double dPriority)
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
bool exists(uint256 hash)
bool ReadFeeEstimates(CAutoFile &filein)
unsigned int GetTransactionsUpdated() const
void check(const CCoinsViewCache *pcoins) const
If sanity-checking is turned on, check makes sure the pool is consistent (does not contain two transa...
An inpoint - a combination of a transaction and an index n into its vin.
Fee rate in PRCY per kilobyte: CAmount / kB.
The basic transaction that is broadcasted on the network and contained in blocks.
int64_t nTime
... and modified size for priority
Abstract view on the open txout dataset.
Non-refcounted RAII wrapper for FILE*.
CCoinsViewMemPool(CCoinsView *baseIn, CTxMemPool &mempoolIn)
double dPriority
Local time when entering the mempool.
RecursiveMutex cs
sum of all mempool tx' byte sizes
void removeForBlock(const std::vector< CTransaction > &vtx, unsigned int nBlockHeight, std::list< CTransaction > &conflicts)
Called when a block is connected.
void PrioritiseTransaction(const uint256 hash, const std::string strHash, double dPriorityDelta, const CAmount &nFeeDelta)
Affect CreateNewBlock prioritisation of transactions.
void remove(const CTransaction &tx, std::list< CTransaction > &removed, bool fRecursive=false)
void setSanityCheck(bool _fSanityCheck)
int64_t CAmount
Amount in PRCY (Can be negative)
uint64_t GetTotalTxSize()
bool lookup(uint256 hash, CTransaction &result) const
256-bit unsigned big integer.
CMinerPolicyEstimator * minerPolicyEstimator
uint64_t totalTxSize
Passed to constructor to avoid dependency on main.
double AllowFreeThreshold()
bool addUnchecked(const uint256 &hash, const CTxMemPoolEntry &entry)
void queryHashes(std::vector< uint256 > &vtxid)
bool WriteFeeEstimates(CAutoFile &fileout) const
Write/Read estimates to disk.
std::map< COutPoint, CInPoint > mapNextTx
CCoinsView that adds a memory cache for transactions to another CCoinsView.
CCoinsView backed by another CCoinsView.
size_t nTxSize
Cached to avoid expensive parent-transaction lookups.
bool HaveCoins(const uint256 &txid) const
Just check whether we have data for a given txid.
CTxMemPool(const CFeeRate &_minRelayFee)
std::map< uint256, CTxMemPoolEntry > mapTx
double GetPriority(unsigned int currentHeight) const
CFeeRate estimateFee(int nBlocks) const
Estimate fee rate needed to get into the next nBlocks.
CInPoint(const CTransaction *ptxIn, uint32_t nIn)
CCoinsView that brings transactions from a memorypool into view.
void ApplyDeltas(const uint256 hash, double &dPriorityDelta, CAmount &nFeeDelta)
size_t nModSize
... and avoid recomputing tx size
std::map< uint256, std::pair< double, CAmount > > mapDeltas
unsigned int nTransactionsUpdated
Normally false, true if -checkmempool or -regtest.
unsigned int nHeight
Priority when entering the mempool.
void removeConflicts(const CTransaction &tx, std::list< CTransaction > &removed)
double estimatePriority(int nBlocks) const
Estimate priority needed to get into the next nBlocks.
void ClearPrioritisation(const uint256 hash)
const CTransaction & GetTx() const