Skip to content

Commit 0ba8947

Browse files
committed
Use constant for max msats
1 parent d892855 commit 0ba8947

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lightning/src/routing/router.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use bitcoin::secp256k1::key::PublicKey;
77

88
use ln::channelmanager;
99
use ln::features::{ChannelFeatures, NodeFeatures};
10-
use ln::msgs::{DecodeError,ErrorAction,LightningError};
10+
use ln::msgs::{DecodeError, ErrorAction, LightningError, MAX_VALUE_MSAT};
1111
use routing::network_graph::{NetworkGraph, RoutingFees};
1212
use util::ser::{Writeable, Readable};
1313
use util::logger::Logger;
@@ -168,7 +168,7 @@ pub fn get_route<L: Deref>(our_node_id: &PublicKey, network: &NetworkGraph, targ
168168
return Err(LightningError{err: "Cannot generate a route to ourselves", action: ErrorAction::IgnoreError});
169169
}
170170

171-
if final_value_msat > 21_000_000 * 1_0000_0000 * 1000 {
171+
if final_value_msat > MAX_VALUE_MSAT {
172172
return Err(LightningError{err: "Cannot generate a route of more value than all existing satoshis", action: ErrorAction::IgnoreError});
173173
}
174174

0 commit comments

Comments
 (0)