Skip to content

Commit 64a4f1b

Browse files
committed
remove Database::flush
1 parent 3334c8d commit 64a4f1b

File tree

6 files changed

+3
-20
lines changed

6 files changed

+3
-20
lines changed

CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ To decouple the `Wallet` from the `Blockchain` we've made major changes:
2525
- Stop making a request for the block height when calling `Wallet:new`.
2626
- Added `SyncOptions` to capture extra (future) arguments to `Wallet::sync`.
2727
- Removed `max_addresses` sync parameter which determined how many addresses to cache before syncing since this can just be done with `ensure_addresses_cached`.
28+
- remove `flush` method from the `Database` trait.
29+
2830

2931
## [v0.16.1] - [v0.16.0]
3032

@@ -437,4 +439,4 @@ final transaction is created by calling `finish` on the builder.
437439
[v0.16.0]: https://github.com/bitcoindevkit/bdk/compare/v0.15.0...v0.16.0
438440
[v0.16.1]: https://github.com/bitcoindevkit/bdk/compare/v0.16.0...v0.16.1
439441
[v0.17.0]: https://github.com/bitcoindevkit/bdk/compare/v0.16.1...v0.17.0
440-
[unreleased]: https://github.com/bitcoindevkit/bdk/compare/v0.17.0...HEAD
442+
[unreleased]: https://github.com/bitcoindevkit/bdk/compare/v0.17.0...HEAD

src/database/any.rs

-4
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,6 @@ impl Database for AnyDatabase {
254254
fn increment_last_index(&mut self, keychain: KeychainKind) -> Result<u32, Error> {
255255
impl_inner_method!(AnyDatabase, self, increment_last_index, keychain)
256256
}
257-
258-
fn flush(&mut self) -> Result<(), Error> {
259-
impl_inner_method!(AnyDatabase, self, flush)
260-
}
261257
}
262258

263259
impl BatchOperations for AnyBatch {

src/database/keyvalue.rs

-4
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,6 @@ impl Database for Tree {
402402
Ok(val)
403403
})
404404
}
405-
406-
fn flush(&mut self) -> Result<(), Error> {
407-
Ok(Tree::flush(self).map(|_| ())?)
408-
}
409405
}
410406

411407
impl BatchDatabase for Tree {

src/database/memory.rs

-4
Original file line numberDiff line numberDiff line change
@@ -449,10 +449,6 @@ impl Database for MemoryDatabase {
449449

450450
Ok(*value)
451451
}
452-
453-
fn flush(&mut self) -> Result<(), Error> {
454-
Ok(())
455-
}
456452
}
457453

458454
impl BatchDatabase for MemoryDatabase {

src/database/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,6 @@ pub trait Database: BatchOperations {
158158
///
159159
/// It should insert and return `0` if not present in the database
160160
fn increment_last_index(&mut self, keychain: KeychainKind) -> Result<u32, Error>;
161-
162-
/// Force changes to be written to disk
163-
fn flush(&mut self) -> Result<(), Error>;
164161
}
165162

166163
/// Trait for a database that supports batch operations

src/database/sqlite.rs

-4
Original file line numberDiff line numberDiff line change
@@ -881,10 +881,6 @@ impl Database for SqliteDatabase {
881881
}
882882
}
883883
}
884-
885-
fn flush(&mut self) -> Result<(), Error> {
886-
Ok(())
887-
}
888884
}
889885

890886
impl BatchDatabase for SqliteDatabase {

0 commit comments

Comments
 (0)