Skip to content

Commit f994081

Browse files
committed
f wow I wasnt paying attention
1 parent b4acfd4 commit f994081

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2922,18 +2922,6 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
29222922
})
29232923
}
29242924

2925-
#[allow(dead_code)]
2926-
// Messages of up to 64KB should never end up more than half full with addresses, as that would
2927-
// be absurd. We ensure this by checking that at least 100 (our stated public contract on when
2928-
// broadcast_node_announcement panics) of the maximum-length addresses would fit in a 64KB
2929-
// message...
2930-
const HALF_MESSAGE_IS_ADDRS: u32 = ::core::u16::MAX as u32 / (NetAddress::MAX_LEN as u32 + 1) / 2;
2931-
#[deny(const_err)]
2932-
#[allow(dead_code)]
2933-
// ...by failing to compile if the number of addresses that would be half of a message is
2934-
// smaller than 100:
2935-
const STATIC_ASSERT: u32 = Self::HALF_MESSAGE_IS_ADDRS - 100;
2936-
29372925
/// Atomically updates the [`ChannelConfig`] for the given channels.
29382926
///
29392927
/// Once the updates are applied, each eligible channel (advertised with a known short channel

lightning/src/ln/peer_handler.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,6 +1920,18 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, OM: Deref, L: Deref, CM
19201920
}
19211921
}
19221922

1923+
#[allow(dead_code)]
1924+
// Messages of up to 64KB should never end up more than half full with addresses, as that would
1925+
// be absurd. We ensure this by checking that at least 100 (our stated public contract on when
1926+
// broadcast_node_announcement panics) of the maximum-length addresses would fit in a 64KB
1927+
// message...
1928+
const HALF_MESSAGE_IS_ADDRS: u32 = ::core::u16::MAX as u32 / (NetAddress::MAX_LEN as u32 + 1) / 2;
1929+
#[deny(const_err)]
1930+
#[allow(dead_code)]
1931+
// ...by failing to compile if the number of addresses that would be half of a message is
1932+
// smaller than 100:
1933+
const STATIC_ASSERT: u32 = Self::HALF_MESSAGE_IS_ADDRS - 100;
1934+
19231935
/// Generates a signed node_announcement from the given arguments, sending it to all connected
19241936
/// peers. Note that peers will likely ignore this message unless we have at least one public
19251937
/// channel which has at least six confirmations on-chain.

0 commit comments

Comments
 (0)