mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-03-03 18:47:38 +01:00
Fix rescan for existing wallets (#4656)
This commit is contained in:
parent
4e4e4aa9ed
commit
7c112b8a90
1 changed files with 5 additions and 1 deletions
|
@ -688,10 +688,14 @@ case class DataMessageHandler(
|
||||||
creationTimeHeight <- creationTimeHeightF
|
creationTimeHeight <- creationTimeHeightF
|
||||||
filterCount <- filterCountF
|
filterCount <- filterCountF
|
||||||
} yield {
|
} yield {
|
||||||
|
//filterHeightOpt contains the height of the last filter of the last batch
|
||||||
|
//so if we want to start syncing filters from the correct height we need to
|
||||||
|
//decrease the computed height
|
||||||
|
val height = Math.max(0, creationTimeHeight - 1)
|
||||||
//want to choose the maximum out of these too
|
//want to choose the maximum out of these too
|
||||||
//if our internal chainstate filter count is > creationTimeHeight
|
//if our internal chainstate filter count is > creationTimeHeight
|
||||||
//we just want to start syncing from our last seen filter
|
//we just want to start syncing from our last seen filter
|
||||||
Some(Math.max(creationTimeHeight, filterCount))
|
Some(Math.max(height, filterCount))
|
||||||
}
|
}
|
||||||
case None =>
|
case None =>
|
||||||
Future.successful(None)
|
Future.successful(None)
|
||||||
|
|
Loading…
Add table
Reference in a new issue