Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #2106 : MaxHeaders constant is used instead of epochLength related value in chainSlice limit #2110

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ case class BlocksApiRoute(viewHolderRef: ActorRef, readersHolder: ActorRef, ergo
getModifierByIdR
}

private val maxHeadersInOneQuery = ergoSettings.chainSettings.epochLength * 2

private def getHistory: Future[ErgoHistoryReader] =
(readersHolder ? GetDataFromHistory[ErgoHistoryReader](r => r)).mapTo[ErgoHistoryReader]

Expand Down Expand Up @@ -105,7 +103,7 @@ case class BlocksApiRoute(viewHolderRef: ActorRef, readersHolder: ActorRef, ergo
val headers = maxHeaderOpt
.toIndexedSeq
.flatMap { maxHeader =>
history.headerChainBack(maxHeadersInOneQuery, maxHeader, _.height <= fromHeight + 1).headers
history.headerChainBack(MaxHeaders, maxHeader, _.height <= fromHeight + 1).headers
}
headers.toList.asJson
}
Expand Down