Only update wallet's sync height if we don't have a match in processCompactFilter() (#4169)

This commit is contained in:
Chris Stewart 2022-03-07 10:36:41 -06:00 committed by GitHub
parent ec384a8b39
commit d63e845de4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -207,9 +207,18 @@ abstract class Wallet
_ <- {
heightOpt match {
case Some(height) =>
stateDescriptorDAO
.updateSyncHeight(hash, height)
.map(_ => ())
if (blockHashToDownload.isEmpty) {
//if we don't have any block hashes
//we need to update the wallet's sync height
stateDescriptorDAO
.updateSyncHeight(hash, height)
.map(_ => ())
} else {
//if we do have a block hash that we matched
//we need to let wallet.processBlock()
//update the wallet's sync height
Future.unit
}
case None =>
Future.unit
}