From 3cb0db5651caf0693dbebd100d8ad9feb63608fd Mon Sep 17 00:00:00 2001 From: gagarin55 Date: Wed, 11 May 2016 21:13:46 +0400 Subject: [PATCH] http api /external-payment returns invalid signature error message --- .../scorex/waves/http/WavesApiRoute.scala | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/main/scala/scorex/waves/http/WavesApiRoute.scala b/src/main/scala/scorex/waves/http/WavesApiRoute.scala index 6df87a0bc30..f3bd320ca9f 100644 --- a/src/main/scala/scorex/waves/http/WavesApiRoute.scala +++ b/src/main/scala/scorex/waves/http/WavesApiRoute.scala @@ -68,21 +68,25 @@ case class WavesApiRoute(override val application: Application)(implicit val con WrongJson.json case JsSuccess(payment: ExternalPayment, _) => val tx = transactionModule.broadcastPayment(payment) - tx.validate match { - case ValidationResult.ValidateOke => - tx.json + if (!tx.signatureValid) + InvalidSignature.json + else { + tx.validate match { + case ValidationResult.ValidateOke => + tx.json - case ValidationResult.InvalidAddress => - InvalidAddress.json + case ValidationResult.InvalidAddress => + InvalidAddress.json - case ValidationResult.NegativeAmount => - NegativeAmount.json + case ValidationResult.NegativeAmount => + NegativeAmount.json - case ValidationResult.NegativeFee => - NegativeFee.json + case ValidationResult.NegativeFee => + NegativeFee.json - case ValidationResult.NoBalance => - NoBalance.json + case ValidationResult.NoBalance => + NoBalance.json + } } } }.getOrElse(WrongJson.json).toString