File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff 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.
234245pub ( 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 >
You can’t perform that action at this time.
0 commit comments