File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
eclair-node/src/main/scala/fr/acinq/eclair/api/handlers Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1616
1717package fr .acinq .eclair .api .handlers
1818
19- import akka .http .scaladsl .server .Route
19+ import akka .http .scaladsl .server .{ Route , ValidationRejection }
2020import fr .acinq .eclair .MilliSatoshi
2121import fr .acinq .eclair .api .Service
2222import fr .acinq .eclair .api .directives .EclairDirectives
@@ -36,7 +36,11 @@ trait Fees {
3636 val updateRelayFee : Route = postRequest(" updaterelayfee" ) { implicit t =>
3737 withNodesIdentifier { nodes =>
3838 formFields(" feeBaseMsat" .as[MilliSatoshi ], " feeProportionalMillionths" .as[Long ]) { (feeBase, feeProportional) =>
39- complete(eclairApi.updateRelayFee(nodes, feeBase, feeProportional))
39+ if (feeBase.toLong < 0 || feeProportional < 0 ) {
40+ reject(ValidationRejection (" Fees must be nonnegative" ))
41+ } else {
42+ complete(eclairApi.updateRelayFee(nodes, feeBase, feeProportional))
43+ }
4044 }
4145 }
4246 }
You can’t perform that action at this time.
0 commit comments