File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -1592,13 +1592,23 @@ impl<L: Deref> NetworkGraph<L> where L::Target: Logger {
15921592 }
15931593 }
15941594
1595- let should_relay =
1596- msg. excess_data . len ( ) <= MAX_EXCESS_BYTES_FOR_RELAY &&
1597- msg. excess_address_data . len ( ) <= MAX_EXCESS_BYTES_FOR_RELAY &&
1598- msg. excess_data . len ( ) + msg. excess_address_data . len ( ) <= MAX_EXCESS_BYTES_FOR_RELAY ;
1599-
1600- node. announcement_info = if should_relay {
1601- Some ( NodeAnnouncementInfo :: Relayed ( full_msg. unwrap ( ) . clone ( ) ) )
1595+ node. announcement_info = if let Some ( signed_announcement) = full_msg {
1596+ let should_relay =
1597+ msg. excess_data . len ( ) <= MAX_EXCESS_BYTES_FOR_RELAY &&
1598+ msg. excess_address_data . len ( ) <= MAX_EXCESS_BYTES_FOR_RELAY &&
1599+ msg. excess_data . len ( ) + msg. excess_address_data . len ( ) <= MAX_EXCESS_BYTES_FOR_RELAY ;
1600+
1601+ if should_relay {
1602+ Some ( NodeAnnouncementInfo :: Relayed ( signed_announcement. clone ( ) ) )
1603+ } else {
1604+ Some ( NodeAnnouncementInfo :: Local ( NodeAnnouncementDetails {
1605+ features : msg. features . clone ( ) ,
1606+ last_update : msg. timestamp ,
1607+ rgb : msg. rgb ,
1608+ alias : msg. alias ,
1609+ addresses : msg. addresses . clone ( ) ,
1610+ } ) )
1611+ }
16021612 } else {
16031613 Some ( NodeAnnouncementInfo :: Local ( NodeAnnouncementDetails {
16041614 features : msg. features . clone ( ) ,
You can’t perform that action at this time.
0 commit comments