mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-02-23 22:56:52 +01:00
Fix test failure
This commit is contained in:
parent
5559475534
commit
137d63d4a4
1 changed files with 4 additions and 6 deletions
|
@ -529,20 +529,18 @@ case class ChainHandler(
|
|||
if (currentHeight >= maxHeight) {
|
||||
Future.successful(accum)
|
||||
} else {
|
||||
val batchStartHeight = if (currentHeight == 0) {
|
||||
0
|
||||
val (batchStartHeight, prev) = if (currentHeight == 0) {
|
||||
(0, Vector.empty)
|
||||
} else {
|
||||
currentHeight + 1
|
||||
(currentHeight + 1, Vector(highestHeaderOpt).flatten)
|
||||
}
|
||||
|
||||
val batchEndHeight = Math.min(maxHeight, currentHeight + batchSize)
|
||||
|
||||
for {
|
||||
headersToCalc <- blockHeaderDAO.getBetweenHeights(batchStartHeight,
|
||||
batchEndHeight)
|
||||
sortedHeaders = headersToCalc.sortBy(_.height)
|
||||
headersWithWork <- loop(sortedHeaders,
|
||||
Vector(highestHeaderOpt).flatten)
|
||||
headersWithWork <- loop(sortedHeaders, prev)
|
||||
next <- loop2(maxHeight, headersWithWork)
|
||||
} yield next
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue