mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2024-11-19 09:52:09 +01:00
Fetch blockHeight earlier in TransactionProcessing.processBlock() (#4025)
This commit is contained in:
parent
8d04ca1cd3
commit
883b01006d
@ -52,6 +52,7 @@ private[bitcoins] trait TransactionProcessing extends WalletLogger {
|
||||
logger.info(s"Processing block=${block.blockHeader.hash.flip.hex}")
|
||||
val start = TimeUtil.currentEpochMs
|
||||
val isEmptyF = isEmpty()
|
||||
val heightF = chainQueryApi.getBlockHeight(block.blockHeader.hashBE)
|
||||
val resF = for {
|
||||
isEmpty <- isEmptyF
|
||||
newWallet <- {
|
||||
@ -69,7 +70,7 @@ private[bitcoins] trait TransactionProcessing extends WalletLogger {
|
||||
val f = for {
|
||||
res <- resF
|
||||
hash = block.blockHeader.hashBE
|
||||
height <- chainQueryApi.getBlockHeight(hash)
|
||||
height <- heightF
|
||||
_ <- stateDescriptorDAO.updateSyncHeight(hash, height.get)
|
||||
_ <- walletConfig.walletCallbacks.executeOnBlockProcessed(logger, block)
|
||||
} yield {
|
||||
|
Loading…
Reference in New Issue
Block a user