aboutsummaryrefslogtreecommitdiff
path: root/src/coins.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-05-30 17:58:54 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2017-06-01 13:15:25 -0700
commit589827975f9f241e2f23eb674a7383592bff1cad (patch)
treedeb06b310de4bc57ae18cc4dd763fe0146ddae6c /src/coins.h
parenta5e02bc7f8a1af27fcafd892d8da651e8f1ab156 (diff)
scripted-diff: various renames for per-utxo consistency
Thanks to John Newberry for pointing these out. -BEGIN VERIFY SCRIPT- sed -i 's/\<GetCoins\>/GetCoin/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<HaveCoins\>/HaveCoin/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<HaveCoinsInCache\>/HaveCoinInCache/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<IsPruned\>/IsSpent/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<FetchCoins\>/FetchCoin/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<CoinsEntry\>/CoinEntry/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<vHashTxnToUncache\>/coins_to_uncache/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<vHashTxToUncache\>/coins_to_uncache/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<fHadTxInCache\>/had_coin_in_cache/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<coinbaseids\>/coinbase_coins/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<disconnectedids\>/disconnected_coins/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<duplicateids\>/duplicate_coins/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<oldcoins\>/old_coin/g' src/test/coins_tests.cpp sed -i 's/\<origcoins\>/orig_coin/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h -END VERIFY SCRIPT-
Diffstat (limited to 'src/coins.h')
-rw-r--r--src/coins.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/coins.h b/src/coins.h
index 294abb6782..476db8f37c 100644
--- a/src/coins.h
+++ b/src/coins.h
@@ -58,7 +58,7 @@ public:
template<typename Stream>
void Serialize(Stream &s) const {
- assert(!IsPruned());
+ assert(!IsSpent());
uint32_t code = nHeight * 2 + fCoinBase;
::Serialize(s, VARINT(code));
::Serialize(s, CTxOutCompressor(REF(out)));
@@ -73,7 +73,7 @@ public:
::Unserialize(s, REF(CTxOutCompressor(out)));
}
- bool IsPruned() const {
+ bool IsSpent() const {
return out.IsNull();
}
@@ -147,11 +147,11 @@ class CCoinsView
{
public:
//! Retrieve the Coin (unspent transaction output) for a given outpoint.
- virtual bool GetCoins(const COutPoint &outpoint, Coin &coin) const;
+ virtual bool GetCoin(const COutPoint &outpoint, Coin &coin) const;
//! Just check whether we have data for a given outpoint.
//! This may (but cannot always) return true for spent outputs.
- virtual bool HaveCoins(const COutPoint &outpoint) const;
+ virtual bool HaveCoin(const COutPoint &outpoint) const;
//! Retrieve the block hash whose state this CCoinsView currently represents
virtual uint256 GetBestBlock() const;
@@ -179,8 +179,8 @@ protected:
public:
CCoinsViewBacked(CCoinsView *viewIn);
- bool GetCoins(const COutPoint &outpoint, Coin &coin) const override;
- bool HaveCoins(const COutPoint &outpoint) const override;
+ bool GetCoin(const COutPoint &outpoint, Coin &coin) const override;
+ bool HaveCoin(const COutPoint &outpoint) const override;
uint256 GetBestBlock() const override;
void SetBackend(CCoinsView &viewIn);
bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) override;
@@ -207,22 +207,22 @@ public:
CCoinsViewCache(CCoinsView *baseIn);
// Standard CCoinsView methods
- bool GetCoins(const COutPoint &outpoint, Coin &coin) const;
- bool HaveCoins(const COutPoint &outpoint) const;
+ bool GetCoin(const COutPoint &outpoint, Coin &coin) const;
+ bool HaveCoin(const COutPoint &outpoint) const;
uint256 GetBestBlock() const;
void SetBestBlock(const uint256 &hashBlock);
bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock);
/**
* Check if we have the given utxo already loaded in this cache.
- * The semantics are the same as HaveCoins(), but no calls to
+ * The semantics are the same as HaveCoin(), but no calls to
* the backing CCoinsView are made.
*/
- bool HaveCoinsInCache(const COutPoint &outpoint) const;
+ bool HaveCoinInCache(const COutPoint &outpoint) const;
/**
* Return a reference to Coin in the cache, or a pruned one if not found. This is
- * more efficient than GetCoins. Modifications to other cache entries are
+ * more efficient than GetCoin. Modifications to other cache entries are
* allowed while accessing the returned pointer.
*/
const Coin& AccessCoin(const COutPoint &output) const;
@@ -273,7 +273,7 @@ public:
bool HaveInputs(const CTransaction& tx) const;
private:
- CCoinsMap::iterator FetchCoins(const COutPoint &outpoint) const;
+ CCoinsMap::iterator FetchCoin(const COutPoint &outpoint) const;
/**
* By making the copy constructor private, we prevent accidentally using it when one intends to create a cache on top of a base cache.