Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 60d0c56

Browse files
committedMar 10, 2022
fix iterator for older rust versions
1 parent 298d542 commit 60d0c56

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎lightning/src/routing/network_graph.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl NodeId {
6767
pub fn from_pubkey(pubkey: &PublicKey) -> Self {
6868
NodeId(pubkey.serialize())
6969
}
70-
70+
7171
/// Get the public key slice from this NodeId
7272
pub fn as_slice(&self) -> &[u8] {
7373
&self.0
@@ -1127,8 +1127,8 @@ impl NetworkGraph {
11271127
}
11281128

11291129
fn add_channel_between_nodes(mut nodes: RwLockWriteGuard<BTreeMap<NodeId, NodeInfo>>, node_id_a: NodeId, node_id_b: NodeId, short_channel_id: u64) -> Result<(), LightningError> {
1130-
for current_node_id in [node_id_a, node_id_b] {
1131-
match nodes.entry(current_node_id) {
1130+
for current_node_id in [node_id_a, node_id_b].iter() {
1131+
match nodes.entry(current_node_id.clone()) {
11321132
BtreeEntry::Occupied(node_entry) => {
11331133
node_entry.into_mut().channels.push(short_channel_id);
11341134
},
@@ -1547,7 +1547,7 @@ mod tests {
15471547
use ln::features::{ChannelFeatures, InitFeatures, NodeFeatures};
15481548
use routing::network_graph::{NetGraphMsgHandler, NetworkGraph, NetworkUpdate, MAX_EXCESS_BYTES_FOR_RELAY};
15491549
use ln::msgs::{Init, OptionalField, RoutingMessageHandler, UnsignedNodeAnnouncement, NodeAnnouncement,
1550-
UnsignedChannelAnnouncement, ChannelAnnouncement, UnsignedChannelUpdate, ChannelUpdate,
1550+
UnsignedChannelAnnouncement, ChannelAnnouncement, UnsignedChannelUpdate, ChannelUpdate,
15511551
ReplyChannelRange, ReplyShortChannelIdsEnd, QueryChannelRange, QueryShortChannelIds, MAX_VALUE_MSAT};
15521552
use util::test_utils;
15531553
use util::logger::Logger;

0 commit comments

Comments
 (0)
Please sign in to comment.