@@ -62,7 +62,6 @@ class DatabaseBatch
6262 DatabaseBatch (const DatabaseBatch&) = delete ;
6363 DatabaseBatch& operator =(const DatabaseBatch&) = delete ;
6464
65- virtual void Flush () = 0;
6665 virtual void Close () = 0;
6766
6867 template <typename K, typename T>
@@ -131,18 +130,14 @@ class WalletDatabase
131130{
132131public:
133132 /* * Create dummy DB handle */
134- WalletDatabase () : nUpdateCounter( 0 ) {}
133+ WalletDatabase () = default ;
135134 virtual ~WalletDatabase () = default ;
136135
137136 /* * Open the database if it is not already opened. */
138137 virtual void Open () = 0;
139138
140139 // ! Counts the number of active database users to be sure that the database is not closed while someone is using it
141140 std::atomic<int > m_refcount{0 };
142- /* * Indicate the a new database user has began using the database. Increments m_refcount */
143- virtual void AddRef () = 0;
144- /* * Indicate that database user has stopped using the database and that it could be flushed or closed. Decrement m_refcount */
145- virtual void RemoveRef () = 0;
146141
147142 /* * Rewrite the entire database on disk, with the exception of key pszSkip if non-zero
148143 */
@@ -152,33 +147,18 @@ class WalletDatabase
152147 */
153148 virtual bool Backup (const std::string& strDest) const = 0;
154149
155- /* * Make sure all changes are flushed to database file.
156- */
157- virtual void Flush () = 0;
158150 /* * Flush to the database file and close the database.
159151 * Also close the environment if no other databases are open in it.
160152 */
161153 virtual void Close () = 0;
162- /* flush the wallet passively (TRY_LOCK)
163- ideal to be called periodically */
164- virtual bool PeriodicFlush () = 0;
165-
166- virtual void IncrementUpdateCounter () = 0;
167-
168- virtual void ReloadDbEnv () = 0;
169154
170155 /* * Return path to main database file for logs and error messages. */
171156 virtual std::string Filename () = 0;
172157
173158 virtual std::string Format () = 0;
174159
175- std::atomic<unsigned int > nUpdateCounter;
176- unsigned int nLastSeen{0 };
177- unsigned int nLastFlushed{0 };
178- int64_t nLastWalletUpdate{0 };
179-
180160 /* * Make a DatabaseBatch connected to this database */
181- virtual std::unique_ptr<DatabaseBatch> MakeBatch (bool flush_on_close = true ) = 0;
161+ virtual std::unique_ptr<DatabaseBatch> MakeBatch () = 0;
182162};
183163
184164enum class DatabaseFormat {
0 commit comments