mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2024-11-19 18:02:54 +01:00
Rescan failure logging (#4250)
* Rescan failure * Set rescanning to false inFailure case
This commit is contained in:
parent
a2587677c3
commit
7c1c572081
@ -17,6 +17,7 @@ import org.bitcoins.wallet.{Wallet, WalletLogger}
|
||||
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
import scala.concurrent.{ExecutionContext, Future}
|
||||
import scala.util.{Failure, Success}
|
||||
|
||||
private[wallet] trait RescanHandling extends WalletLogger {
|
||||
self: Wallet =>
|
||||
@ -80,12 +81,15 @@ private[wallet] trait RescanHandling extends WalletLogger {
|
||||
RescanState.RescanDone
|
||||
}
|
||||
|
||||
res.onComplete { _ =>
|
||||
rescanning.set(false)
|
||||
logger.info(
|
||||
s"Finished rescanning the wallet. It took ${System.currentTimeMillis() - start}ms")
|
||||
res.onComplete {
|
||||
case Success(_) =>
|
||||
rescanning.set(false)
|
||||
logger.info(
|
||||
s"Finished rescanning the wallet. It took ${System.currentTimeMillis() - start}ms")
|
||||
case Failure(err) =>
|
||||
rescanning.set(false)
|
||||
logger.error(s"Failed to rescan wallet", err)
|
||||
}
|
||||
|
||||
res
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user