@@ -1599,81 +1599,10 @@ static void opening_got_hsm_funding_sig(struct funding_channel *fc,
1599
1599
tal_free (fc );
1600
1600
}
1601
1601
1602
- /* Create a node_announcement with the given signature. It may be NULL
1603
- * in the case we need to create a provisional announcement for the
1604
- * HSM to sign. This is typically called twice: once with the dummy
1605
- * signature to get it signed and a second time to build the full
1606
- * packet with the signature. The timestamp is handed in since that is
1607
- * the only thing that may change between the dummy creation and the
1608
- * call with a signature.*/
1609
- static u8 * create_node_announcement (const tal_t * ctx , struct lightningd * ld ,
1610
- secp256k1_ecdsa_signature * sig ,
1611
- u32 timestamp )
1612
- {
1613
- u8 * features = NULL ;
1614
- u8 * addresses = tal_arr (ctx , u8 , 0 );
1615
- u8 * announcement ;
1616
- size_t i ;
1617
- if (!sig ) {
1618
- sig = tal (ctx , secp256k1_ecdsa_signature );
1619
- memset (sig , 0 , sizeof (* sig ));
1620
- }
1621
- for (i = 0 ; i < tal_count (ld -> wireaddrs ); i ++ )
1622
- towire_wireaddr (& addresses , ld -> wireaddrs + i );
1623
-
1624
- announcement =
1625
- towire_node_announcement (ctx , sig , features , timestamp ,
1626
- & ld -> id , ld -> rgb , (u8 * )ld -> alias ,
1627
- addresses );
1628
- return announcement ;
1629
- }
1630
-
1631
1602
/* We were informed by channeld that it announced the channel and sent
1632
1603
* an update, so we can now start sending a node_announcement. The
1633
1604
* first step is to build the provisional announcement and ask the HSM
1634
1605
* to sign it. */
1635
- static void peer_channel_announce (struct peer * peer , const u8 * msg )
1636
- {
1637
- struct lightningd * ld = peer -> ld ;
1638
- tal_t * tmpctx = tal_tmpctx (peer );
1639
- secp256k1_ecdsa_signature sig ;
1640
- u8 * cannounce , * cupdate ;
1641
- u8 * announcement , * wrappedmsg ;
1642
- u32 timestamp = time_now ().ts .tv_sec ;
1643
-
1644
- if (!fromwire_channel_announce (msg , msg , NULL , & cannounce , & cupdate )) {
1645
- peer_internal_error (peer , "bad fromwire_channel_announced %s" ,
1646
- tal_hex (peer , msg ));
1647
- return ;
1648
- }
1649
-
1650
- msg = towire_hsm_node_announcement_sig_req (
1651
- tmpctx , create_node_announcement (tmpctx , ld , NULL , timestamp ));
1652
-
1653
- if (!wire_sync_write (ld -> hsm_fd , take (msg )))
1654
- fatal ("Could not write to HSM: %s" , strerror (errno ));
1655
-
1656
- msg = hsm_sync_read (tmpctx , ld );
1657
- if (!fromwire_hsm_node_announcement_sig_reply (msg , NULL , & sig ))
1658
- fatal ("HSM returned an invalid node_announcement sig" );
1659
-
1660
- /* We got the signature for out provisional node_announcement back
1661
- * from the HSM, create the real announcement and forward it to
1662
- * gossipd so it can take care of forwarding it. */
1663
- announcement = create_node_announcement (tmpctx , ld , & sig , timestamp );
1664
-
1665
- /* We have to send channel_announce before channel_update and
1666
- * node_announcement */
1667
- wrappedmsg = towire_gossip_forwarded_msg (tmpctx , cannounce );
1668
- subd_send_msg (ld -> gossip , take (wrappedmsg ));
1669
-
1670
- wrappedmsg = towire_gossip_forwarded_msg (tmpctx , cupdate );
1671
- subd_send_msg (ld -> gossip , take (wrappedmsg ));
1672
-
1673
- wrappedmsg = towire_gossip_forwarded_msg (tmpctx , announcement );
1674
- subd_send_msg (ld -> gossip , take (wrappedmsg ));
1675
- tal_free (tmpctx );
1676
- }
1677
1606
1678
1607
static void peer_got_funding_locked (struct peer * peer , const u8 * msg )
1679
1608
{
@@ -2022,9 +1951,6 @@ static unsigned channel_msg(struct subd *sd, const u8 *msg, const int *fds)
2022
1951
case WIRE_CHANNEL_GOT_REVOKE :
2023
1952
peer_got_revoke (sd -> peer , msg );
2024
1953
break ;
2025
- case WIRE_CHANNEL_ANNOUNCE :
2026
- peer_channel_announce (sd -> peer , msg );
2027
- break ;
2028
1954
case WIRE_CHANNEL_GOT_FUNDING_LOCKED :
2029
1955
peer_got_funding_locked (sd -> peer , msg );
2030
1956
break ;
@@ -2419,7 +2345,7 @@ static unsigned int opening_negotiation_failed(struct subd *openingd,
2419
2345
/* We need the peer fd and gossip fd. */
2420
2346
if (tal_count (fds ) == 0 )
2421
2347
return 2 ;
2422
-
2348
+
2423
2349
if (!fromwire_opening_negotiation_failed (msg , msg , NULL ,
2424
2350
& cs , & gossip_index , & err )) {
2425
2351
peer_internal_error (peer ,
0 commit comments