Skip to content

Commit a33f9a8

Browse files
committed
add update -sync blocker
1 parent 424ded7 commit a33f9a8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/ln/msgs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ pub trait ChannelMessageHandler : events::MessageSendEventsProvider + Send + Syn
575575
/// Handle an incoming error message from the given peer.
576576
fn handle_error(&self, their_node_id: &PublicKey, msg: &ErrorMessage);
577577
}
578-
578+
#[derive(PartialEq)]
579579
///Enum used to keep track of syncing information/state of peer and if a sync is required
580580
pub enum InitSyncTracker{
581581
///This indicates if a sync is required or not, false is no sync required, true is sync required but not started

src/ln/peer_handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ impl<Descriptor: SocketDescriptor> PeerManager<Descriptor> {
927927
let encoded_msg = encode_msg!(msg, 258);
928928

929929
for (ref descriptor, ref mut peer) in peers.peers.iter_mut() {
930-
if !peer.channel_encryptor.is_ready_for_encryption() || peer.their_global_features.is_none() {
930+
if !peer.channel_encryptor.is_ready_for_encryption() || peer.their_global_features.is_none() || peer.sync_status != msgs::InitSyncTracker::Sync(false) {
931931
continue
932932
}
933933
peer.pending_outbound_buffer.push_back(peer.channel_encryptor.encrypt_message(&encoded_msg[..]));

0 commit comments

Comments
 (0)