![]() |
Master Core
v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
|
CCoinsView that adds a memory cache for transactions to another CCoinsView. More...
#include <coins.h>
Inheritance diagram for CCoinsViewCache:
Collaboration diagram for CCoinsViewCache:Public Member Functions | |
| CCoinsViewCache (CCoinsView &baseIn, bool fDummy=false) | |
| bool | GetCoins (const uint256 &txid, CCoins &coins) |
| bool | SetCoins (const uint256 &txid, const CCoins &coins) |
| bool | HaveCoins (const uint256 &txid) |
| uint256 | GetBestBlock () |
| bool | SetBestBlock (const uint256 &hashBlock) |
| bool | BatchWrite (const std::map< uint256, CCoins > &mapCoins, const uint256 &hashBlock) |
| CCoins & | GetCoins (const uint256 &txid) |
| bool | Flush () |
| unsigned int | GetCacheSize () |
| int64_t | GetValueIn (const CTransaction &tx) |
| Amount of bitcoins coming in to a transaction Note that lightweight clients may not know anything besides the hash of previous transactions, so may not be able to calculate this. More... | |
| bool | HaveInputs (const CTransaction &tx) |
| double | GetPriority (const CTransaction &tx, int nHeight) |
| const CTxOut & | GetOutputFor (const CTxIn &input) |
Public Member Functions inherited from CCoinsViewBacked | |
| CCoinsViewBacked (CCoinsView &viewIn) | |
| void | SetBackend (CCoinsView &viewIn) |
| bool | GetStats (CCoinsStats &stats) |
Public Member Functions inherited from CCoinsView | |
| virtual | ~CCoinsView () |
Protected Attributes | |
| uint256 | hashBlock |
| std::map< uint256, CCoins > | cacheCoins |
Protected Attributes inherited from CCoinsViewBacked | |
| CCoinsView * | base |
Private Member Functions | |
| std::map< uint256, CCoins >::iterator | FetchCoins (const uint256 &txid) |
CCoinsView that adds a memory cache for transactions to another CCoinsView.
| CCoinsViewCache::CCoinsViewCache | ( | CCoinsView & | baseIn, |
| bool | fDummy = false |
||
| ) |
|
virtual |
Reimplemented from CCoinsViewBacked.
Definition at line 124 of file coins.cpp.
References cacheCoins, and hashBlock.
Definition at line 86 of file coins.cpp.
References CCoinsViewBacked::base, cacheCoins, CCoinsView::GetCoins(), and CCoins::swap().
Referenced by GetCoins(), and HaveCoins().
Here is the call graph for this function:
Here is the caller graph for this function:| bool CCoinsViewCache::Flush | ( | ) |
Definition at line 131 of file coins.cpp.
References CCoinsViewBacked::base, CCoinsView::BatchWrite(), cacheCoins, and hashBlock.
Referenced by ConnectTip(), DisconnectTip(), Shutdown(), and WriteChainState().
Here is the call graph for this function:
Here is the caller graph for this function:
|
virtual |
Reimplemented from CCoinsViewBacked.
Definition at line 113 of file coins.cpp.
References CCoinsViewBacked::base, CCoinsView::GetBestBlock(), and hashBlock.
Referenced by AcceptToMemoryPool(), CheckInputs(), ConnectBlock(), DisconnectBlock(), gettxout(), and LoadBlockIndexDB().
Here is the call graph for this function:
Here is the caller graph for this function:| unsigned int CCoinsViewCache::GetCacheSize | ( | ) |
Definition at line 138 of file coins.cpp.
References cacheCoins.
Referenced by VerifyDB(), and WriteChainState().
Here is the caller graph for this function:Reimplemented from CCoinsViewBacked.
Definition at line 74 of file coins.cpp.
References CCoinsViewBacked::base, cacheCoins, and CCoinsView::GetCoins().
Referenced by CTxMemPool::check(), CheckInputs(), ConnectBlock(), CreateNewBlock(), DisconnectBlock(), GetOutputFor(), GetPriority(), GetTransaction(), gettxout(), HaveInputs(), sendrawtransaction(), signrawtransaction(), TransactionDesc::toHTML(), and UpdateCoins().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 98 of file coins.cpp.
References cacheCoins, and FetchCoins().
Here is the call graph for this function:Definition at line 142 of file coins.cpp.
References GetCoins(), COutPoint::hash, CCoins::IsAvailable(), COutPoint::n, CTxIn::prevout, and CCoins::vout.
Referenced by AreInputsStandard(), GetP2SHSigOpCount(), and GetValueIn().
Here is the call graph for this function:
Here is the caller graph for this function:| double CCoinsViewCache::GetPriority | ( | const CTransaction & | tx, |
| int | nHeight | ||
| ) |
Definition at line 182 of file coins.cpp.
References CTransaction::ComputePriority(), GetCoins(), COutPoint::hash, CCoins::IsAvailable(), CTransaction::IsCoinBase(), COutPoint::n, CCoins::nHeight, CTxIn::prevout, CTransaction::vin, and CCoins::vout.
Referenced by AcceptToMemoryPool().
Here is the call graph for this function:
Here is the caller graph for this function:| int64_t CCoinsViewCache::GetValueIn | ( | const CTransaction & | tx | ) |
Amount of bitcoins coming in to a transaction Note that lightweight clients may not know anything besides the hash of previous transactions, so may not be able to calculate this.
| [in] | tx | transaction for which we are checking input total |
Definition at line 149 of file coins.cpp.
References GetOutputFor(), CTransaction::IsCoinBase(), CTxOut::nValue, and CTransaction::vin.
Referenced by AcceptToMemoryPool(), ConnectBlock(), and CreateNewBlock().
Here is the call graph for this function:
Here is the caller graph for this function:
|
virtual |
Reimplemented from CCoinsViewBacked.
Definition at line 109 of file coins.cpp.
References cacheCoins, and FetchCoins().
Referenced by AcceptToMemoryPool(), AlreadyHave(), ConnectBlock(), CreateNewBlock(), DisconnectBlock(), and HaveInputs().
Here is the call graph for this function:
Here is the caller graph for this function:| bool CCoinsViewCache::HaveInputs | ( | const CTransaction & | tx | ) |
Definition at line 161 of file coins.cpp.
References GetCoins(), COutPoint::hash, HaveCoins(), CCoins::IsAvailable(), CTransaction::IsCoinBase(), COutPoint::n, and CTransaction::vin.
Referenced by AcceptToMemoryPool(), CheckInputs(), ConnectBlock(), and CreateNewBlock().
Here is the call graph for this function:
Here is the caller graph for this function:
|
virtual |
Reimplemented from CCoinsViewBacked.
Definition at line 119 of file coins.cpp.
References hashBlock.
Referenced by ConnectBlock(), and DisconnectBlock().
Here is the caller graph for this function:Reimplemented from CCoinsViewBacked.
Definition at line 104 of file coins.cpp.
References cacheCoins.
Referenced by DisconnectBlock(), signrawtransaction(), and UpdateCoins().
Here is the caller graph for this function:Definition at line 312 of file coins.h.
Referenced by BatchWrite(), FetchCoins(), Flush(), GetCacheSize(), GetCoins(), HaveCoins(), and SetCoins().
|
protected |
Definition at line 311 of file coins.h.
Referenced by BatchWrite(), Flush(), GetBestBlock(), and SetBestBlock().
1.8.8