File tree Expand file tree Collapse file tree 2 files changed +22
-22
lines changed Expand file tree Collapse file tree 2 files changed +22
-22
lines changed Original file line number Diff line number Diff line change @@ -168,6 +168,28 @@ bool CBlockTreeDB::ReadLastBlockFile(int &nFile) {
168
168
return Read (DB_LAST_BLOCK, nFile);
169
169
}
170
170
171
+ /* * Specialization of CCoinsViewCursor to iterate over a CCoinsViewDB */
172
+ class CCoinsViewDBCursor : public CCoinsViewCursor
173
+ {
174
+ public:
175
+ CCoinsViewDBCursor (CDBIterator* pcursorIn, const uint256&hashBlockIn):
176
+ CCoinsViewCursor (hashBlockIn), pcursor(pcursorIn) {}
177
+ ~CCoinsViewDBCursor () {}
178
+
179
+ bool GetKey (COutPoint &key) const override ;
180
+ bool GetValue (Coin &coin) const override ;
181
+ unsigned int GetValueSize () const override ;
182
+
183
+ bool Valid () const override ;
184
+ void Next () override ;
185
+
186
+ private:
187
+ std::unique_ptr<CDBIterator> pcursor;
188
+ std::pair<char , COutPoint> keyTmp;
189
+
190
+ friend class CCoinsViewDB ;
191
+ };
192
+
171
193
std::unique_ptr<CCoinsViewCursor> CCoinsViewDB::Cursor () const
172
194
{
173
195
auto i = std::make_unique<CCoinsViewDBCursor>(
Original file line number Diff line number Diff line change @@ -70,28 +70,6 @@ class CCoinsViewDB final : public CCoinsView
70
70
void ResizeCache (size_t new_cache_size) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
71
71
};
72
72
73
- /* * Specialization of CCoinsViewCursor to iterate over a CCoinsViewDB */
74
- class CCoinsViewDBCursor : public CCoinsViewCursor
75
- {
76
- public:
77
- CCoinsViewDBCursor (CDBIterator* pcursorIn, const uint256 &hashBlockIn):
78
- CCoinsViewCursor (hashBlockIn), pcursor(pcursorIn) {}
79
- ~CCoinsViewDBCursor () {}
80
-
81
- bool GetKey (COutPoint &key) const override ;
82
- bool GetValue (Coin &coin) const override ;
83
- unsigned int GetValueSize () const override ;
84
-
85
- bool Valid () const override ;
86
- void Next () override ;
87
-
88
- private:
89
- std::unique_ptr<CDBIterator> pcursor;
90
- std::pair<char , COutPoint> keyTmp;
91
-
92
- friend class CCoinsViewDB ;
93
- };
94
-
95
73
/* * Access to the block database (blocks/index/) */
96
74
class CBlockTreeDB : public CDBWrapper
97
75
{
You can’t perform that action at this time.
0 commit comments