We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea96e54 commit 992cc63Copy full SHA for 992cc63
lightning/src/routing/router.rs
@@ -24,6 +24,7 @@ use util::logger::Logger;
24
use std::cmp;
25
use std::collections::{HashMap,BinaryHeap};
26
use std::ops::Deref;
27
+use std::hash::{Hash, Hasher};
28
29
/// A hop in a route
30
#[derive(Clone, PartialEq)]
@@ -45,6 +46,15 @@ pub struct RouteHop {
45
46
pub cltv_expiry_delta: u32,
47
}
48
49
+impl Eq for RouteHop {}
50
+impl Hash for RouteHop {
51
+ fn hash<H: Hasher>(&self, state: &mut H) {
52
+ self.short_channel_id.hash(state);
53
+ self.fee_msat.hash(state);
54
+ }
55
+}
56
+
57
58
impl Writeable for Vec<RouteHop> {
59
fn write<W: ::util::ser::Writer>(&self, writer: &mut W) -> Result<(), ::std::io::Error> {
60
(self.len() as u8).write(writer)?;
0 commit comments