Skip to content

Commit 3c1ef64

Browse files
author
Antoine Riard
committed
Add remove_channel_info in Router
1 parent 7659877 commit 3c1ef64

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/ln/router.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,17 @@ impl Router {
624624

625625
Err(HandleError{err: "Failed to find a path to the given destination", action: None})
626626
}
627+
628+
/// Drop entry from network map
629+
pub fn remove_channel_info(&self, short_channel_id: u64, chain_hash: Sha256dHash) -> Result<bool, HandleError> {
630+
let mut network = self.network_map.write().unwrap();
631+
632+
match network.channels.remove(&NetworkMap::get_key(short_channel_id, chain_hash)) {
633+
Some(_c) => {},
634+
None => return Err(HandleError{err: "Unable to find channel", action: Some(ErrorAction::IgnoreError)}),
635+
}
636+
Ok(true)
637+
}
627638
}
628639

629640
#[cfg(test)]

0 commit comments

Comments
 (0)