@@ -55,7 +55,7 @@ bool CCoinsView::SetCoins(const uint256 &txid, const CCoins &coins) { return fal
55
55
bool CCoinsView::HaveCoins (const uint256 &txid) { return false ; }
56
56
uint256 CCoinsView::GetBestBlock () { return uint256 (0 ); }
57
57
bool CCoinsView::SetBestBlock (const uint256 &hashBlock) { return false ; }
58
- bool CCoinsView::BatchWrite (const std::map<uint256, CCoins> &mapCoins, const uint256 &hashBlock) { return false ; }
58
+ bool CCoinsView::BatchWrite (const CCoinsMap &mapCoins, const uint256 &hashBlock) { return false ; }
59
59
bool CCoinsView::GetStats (CCoinsStats &stats) { return false ; }
60
60
61
61
@@ -66,7 +66,7 @@ bool CCoinsViewBacked::HaveCoins(const uint256 &txid) { return base->HaveCoins(t
66
66
uint256 CCoinsViewBacked::GetBestBlock () { return base->GetBestBlock (); }
67
67
bool CCoinsViewBacked::SetBestBlock (const uint256 &hashBlock) { return base->SetBestBlock (hashBlock); }
68
68
void CCoinsViewBacked::SetBackend (CCoinsView &viewIn) { base = &viewIn; }
69
- bool CCoinsViewBacked::BatchWrite (const std::map<uint256, CCoins> &mapCoins, const uint256 &hashBlock) { return base->BatchWrite (mapCoins, hashBlock); }
69
+ bool CCoinsViewBacked::BatchWrite (const CCoinsMap &mapCoins, const uint256 &hashBlock) { return base->BatchWrite (mapCoins, hashBlock); }
70
70
bool CCoinsViewBacked::GetStats (CCoinsStats &stats) { return base->GetStats (stats); }
71
71
72
72
CCoinsViewCache::CCoinsViewCache (CCoinsView &baseIn, bool fDummy ) : CCoinsViewBacked(baseIn), hashBlock(0 ) { }
@@ -83,20 +83,20 @@ bool CCoinsViewCache::GetCoins(const uint256 &txid, CCoins &coins) {
83
83
return false ;
84
84
}
85
85
86
- std::map<uint256,CCoins> ::iterator CCoinsViewCache::FetchCoins (const uint256 &txid) {
87
- std::map<uint256,CCoins> ::iterator it = cacheCoins.lower_bound (txid);
86
+ CCoinsMap ::iterator CCoinsViewCache::FetchCoins (const uint256 &txid) {
87
+ CCoinsMap ::iterator it = cacheCoins.lower_bound (txid);
88
88
if (it != cacheCoins.end () && it->first == txid)
89
89
return it;
90
90
CCoins tmp;
91
91
if (!base->GetCoins (txid,tmp))
92
92
return cacheCoins.end ();
93
- std::map<uint256,CCoins> ::iterator ret = cacheCoins.insert (it, std::make_pair (txid, CCoins ()));
93
+ CCoinsMap ::iterator ret = cacheCoins.insert (it, std::make_pair (txid, CCoins ()));
94
94
tmp.swap (ret->second );
95
95
return ret;
96
96
}
97
97
98
98
CCoins &CCoinsViewCache::GetCoins (const uint256 &txid) {
99
- std::map<uint256,CCoins> ::iterator it = FetchCoins (txid);
99
+ CCoinsMap ::iterator it = FetchCoins (txid);
100
100
assert (it != cacheCoins.end ());
101
101
return it->second ;
102
102
}
@@ -121,8 +121,8 @@ bool CCoinsViewCache::SetBestBlock(const uint256 &hashBlockIn) {
121
121
return true ;
122
122
}
123
123
124
- bool CCoinsViewCache::BatchWrite (const std::map<uint256, CCoins> &mapCoins, const uint256 &hashBlockIn) {
125
- for (std::map<uint256, CCoins> ::const_iterator it = mapCoins.begin (); it != mapCoins.end (); it++)
124
+ bool CCoinsViewCache::BatchWrite (const CCoinsMap &mapCoins, const uint256 &hashBlockIn) {
125
+ for (CCoinsMap ::const_iterator it = mapCoins.begin (); it != mapCoins.end (); it++)
126
126
cacheCoins[it->first ] = it->second ;
127
127
hashBlock = hashBlockIn;
128
128
return true ;
0 commit comments