Fixed issue with GET /crosschain/trades API endpoint where the minimumTimestamp parameter returned inconsistent results.

This commit is contained in:
CalDescent 2021-11-24 15:21:08 +00:00
parent 0dcd2e6e93
commit 199833bdd4

View File

@ -195,7 +195,8 @@ public class CrossChainResource {
if (minimumTimestamp != null) {
minimumFinalHeight = repository.getBlockRepository().getHeightFromTimestamp(minimumTimestamp);
if (minimumFinalHeight == 0) {
// If not found in the block repository it will return either 0 or 1
if (minimumFinalHeight == 0 || minimumFinalHeight == 1) {
// Try the archive
minimumFinalHeight = repository.getBlockArchiveRepository().getHeightFromTimestamp(minimumTimestamp);
}