Skip to content

Commit

Permalink
f unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
arik-so committed Jun 6, 2024
1 parent 74712af commit 6befdff
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lightning-rapid-gossip-sync/src/processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use lightning::ln::msgs::{DecodeError, ErrorAction, LightningError, SocketAddres
use lightning::routing::gossip::{NetworkGraph, NodeAlias, NodeId};
use lightning::util::logger::Logger;
use lightning::{log_debug, log_warn, log_trace, log_given_level, log_gossip};
use lightning::util::ser::{BigSize, Readable};
use lightning::io;
use lightning::util::ser::{BigSize, FixedLengthReader, Readable};
use lightning::{io, io::Read};

use crate::{GraphSyncError, RapidGossipSync};

Expand Down Expand Up @@ -141,8 +141,9 @@ impl<NG: Deref<Target=NetworkGraph<L>>, L: Deref> RapidGossipSync<NG, L> where L
let mut node_addresses: Vec<SocketAddress> = Vec::new();
for _ in 0..address_count {
let current_byte_count: u8 = Readable::read(read_cursor)?;
let mut address_bytes = vec![0u8; current_byte_count as usize];
read_cursor.read_exact(&mut address_bytes).unwrap();
let mut address_reader = FixedLengthReader::new(&mut read_cursor, current_byte_count as u64);
let mut address_bytes = Vec::new();
address_reader.read_to_end(&mut address_bytes).unwrap();

let mut address_cursor = io::Cursor::new(&address_bytes);
if let Ok(current_address) = Readable::read(&mut address_cursor) {
Expand Down

0 comments on commit 6befdff

Please sign in to comment.