Skip to content

Commit 750a701

Browse files
committed
f Update migrate_deprecated_spendable_outputs docs
1 parent 23a76dd commit 750a701

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/io/utils.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,18 @@ pub(crate) fn read_output_sweeper<K: KVStore + Send + Sync>(
230230
})
231231
}
232232

233-
/// Read previously persisted spendable output information from the store.
233+
/// Read previously persisted spendable output information from the store and migrate to the
234+
/// upstreamed `OutputSweeper`.
235+
///
236+
/// We first iterate all `DeprecatedSpendableOutputInfo`s and have them tracked by the new
237+
/// `OutputSweeper`. In order to be certain the initial output spends will happen in a single
238+
/// transaction (and safe on-chain fees), we batch them to happen at current height plus two
239+
/// blocks. Lastly, we remove the previously persisted data once we checked they are tracked and
240+
/// awaiting their initial spend at the correct height.
241+
///
242+
/// Note that this migration will be run in the `Builder`, i.e., at the time when the migration is
243+
/// happening no background sync is ongoing, so we shouldn't have a risk of interleaving block
244+
/// connections during the migration.
234245
pub(crate) fn migrate_deprecated_spendable_outputs<K: KVStore + Sync + Send, L: Deref>(
235246
sweeper: Arc<Sweeper<K>>, kv_store: Arc<K>, logger: L,
236247
) -> Result<(), std::io::Error>

0 commit comments

Comments
 (0)