Skip to content

Commit fd8e18e

Browse files
committed
refactoring
1 parent b09895c commit fd8e18e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/scala/org/ergoplatform/http/api/WalletApiRoute.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ case class WalletApiRoute(readersHolder: ActorRef, nodeViewActorRef: ActorRef, e
290290
if ((minHeight > 0 || maxHeight < Int.MaxValue) && // height is set
291291
(minConfNum > 0 || maxConfNum < Int.MaxValue) // confirmations are set
292292
) {
293-
BadRequest(s"Bad request: both heights and confirmations set")
293+
BadRequest("Bad request: both heights and confirmations set")
294294
}
295295
else if (minHeight == 0 && maxHeight == Int.MaxValue && minConfNum == 0 && maxConfNum == Int.MaxValue) {
296296
withWallet {
@@ -316,7 +316,9 @@ case class WalletApiRoute(readersHolder: ActorRef, nodeViewActorRef: ActorRef, e
316316

317317
def getTransactionsByScanIdR: Route = (path("transactionsByScanId" / Segment) & get & txParams) {
318318
case (id, minHeight, maxHeight, minConfNum, maxConfNum) =>
319-
if (minHeight == 0 && maxHeight == Int.MaxValue && minConfNum == 0 && maxConfNum == Int.MaxValue) {
319+
if ((minHeight > 0 || maxHeight < Int.MaxValue) && (minConfNum > 0 || maxConfNum < Int.MaxValue))
320+
BadRequest("Bad request: both heights and confirmations set")
321+
else if (minHeight == 0 && maxHeight == Int.MaxValue && minConfNum == 0 && maxConfNum == Int.MaxValue) {
320322
withWalletOp(_.transactionsByScanId(ScanId @@ id.toShort)) {
321323
resp => ApiResponse(resp.result.asJson)
322324
}

0 commit comments

Comments
 (0)