mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-01-19 14:43:57 +01:00
Set sync height on new wallet (#3368)
This commit is contained in:
parent
09a6ca41cb
commit
629c2a2c31
@ -38,7 +38,12 @@ object BitcoindRpcBackendUtil extends Logging {
|
||||
txDbs <- wallet.listTransactions()
|
||||
lastConfirmedOpt = txDbs.filter(_.blockHashOpt.isDefined).lastOption
|
||||
_ <- lastConfirmedOpt match {
|
||||
case None => Future.unit
|
||||
case None =>
|
||||
for {
|
||||
header <- bitcoind.getBestBlockHeader()
|
||||
_ <- wallet.stateDescriptorDAO.updateSyncHeight(header.hashBE,
|
||||
header.height)
|
||||
} yield ()
|
||||
case Some(txDb) =>
|
||||
for {
|
||||
heightOpt <- bitcoind.getBlockHeight(txDb.blockHashOpt.get)
|
||||
|
@ -81,7 +81,7 @@ abstract class Wallet
|
||||
OutgoingTransactionDAO()
|
||||
private[bitcoins] val addressTagDAO: AddressTagDAO = AddressTagDAO()
|
||||
|
||||
private[wallet] val stateDescriptorDAO: WalletStateDescriptorDAO =
|
||||
private[bitcoins] val stateDescriptorDAO: WalletStateDescriptorDAO =
|
||||
WalletStateDescriptorDAO()
|
||||
|
||||
val nodeApi: NodeApi
|
||||
|
Loading…
Reference in New Issue
Block a user