Skip to content

Commit 637dd49

Browse files
committed
f Add validate_data flag
1 parent 94ce349 commit 637dd49

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lightning/src/util/persist.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,14 @@ pub trait MigratableKVStore: KVStore {
182182
/// might get overriden. User must ensure `source_store` is not modified during operation,
183183
/// otherwise no consistency guarantees can be given.
184184
///
185+
/// Will re-read and validate the written data if `validate_data` is set.
186+
///
185187
/// Will abort and return an error if any IO operation fails. Note that in this case the
186188
/// `target_store` might get left in an intermediate state.
187189
///
188190
/// **Caution**: Will delete all data from `source_store` if `move_data` is set.
189191
pub fn migrate_kv_store_data<S: MigratableKVStore, T: MigratableKVStore>(
190-
source_store: &mut S, target_store: &mut T, move_data: bool,
192+
source_store: &mut S, target_store: &mut T, validate_data: bool, move_data: bool,
191193
) -> Result<(), io::Error> {
192194
let keys_to_migrate = source_store.list_all_keys()?;
193195

0 commit comments

Comments
 (0)