Skip to content

Commit 86bc0ac

Browse files
committed
f explicitly prevent scid alias of 0
1 parent 888a519 commit 86bc0ac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1816,7 +1816,9 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
18161816
} else {
18171817
outbound_scid_alias = fake_scid::Namespace::OutboundAlias.get_fake_scid(height, &self.genesis_hash, &self.fake_scid_rand_bytes, &self.keys_manager);
18181818
}
1819-
if self.outbound_scid_aliases.lock().unwrap().insert(outbound_scid_alias) { break; }
1819+
if outbound_scid_alias != 0 && self.outbound_scid_aliases.lock().unwrap().insert(outbound_scid_alias) {
1820+
break;
1821+
}
18201822
i += 1;
18211823
if i > 1_000_000 { panic!("Your RNG is busted or we ran out of possible outbound SCID aliases (which should never happen before we run out of memory to store channels"); }
18221824
}

0 commit comments

Comments
 (0)