From 5309197150597b6b8a83fcc98090a955bb252d56 Mon Sep 17 00:00:00 2001 From: Gleb Naumenko Date: Tue, 16 Jun 2020 18:58:06 +0300 Subject: [PATCH] Use constant for max msats --- lightning/src/routing/router.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lightning/src/routing/router.rs b/lightning/src/routing/router.rs index d82f8293f..5f3f02dcf 100644 --- a/lightning/src/routing/router.rs +++ b/lightning/src/routing/router.rs @@ -7,7 +7,7 @@ use bitcoin::secp256k1::key::PublicKey; use ln::channelmanager; use ln::features::{ChannelFeatures, NodeFeatures}; -use ln::msgs::{DecodeError,ErrorAction,LightningError}; +use ln::msgs::{DecodeError, ErrorAction, LightningError, MAX_VALUE_MSAT}; use routing::network_graph::{NetworkGraph, RoutingFees}; use util::ser::{Writeable, Readable}; use util::logger::Logger; @@ -168,7 +168,7 @@ pub fn get_route(our_node_id: &PublicKey, network: &NetworkGraph, targ return Err(LightningError{err: "Cannot generate a route to ourselves".to_owned(), action: ErrorAction::IgnoreError}); } - if final_value_msat > 21_000_000 * 1_0000_0000 * 1000 { + if final_value_msat > MAX_VALUE_MSAT { return Err(LightningError{err: "Cannot generate a route of more value than all existing satoshis".to_owned(), action: ErrorAction::IgnoreError}); } -- 2.39.5