MCPcopy Create free account
hub / github.com/ElementsProject/lightning / handle_reply_short_channel_ids_end

Function handle_reply_short_channel_ids_end

gossipd/queries.c:843–872  ·  view source on GitHub ↗

~ When we ask about an array of short_channel_ids, we get all channel & * node announcements and channel updates which the peer knows. There's an * explicit end packet; this is needed to differentiate between 'I'm slow' * and 'I don't know those channels'. */

Source from the content-addressed store, hash-verified

841 * explicit end packet; this is needed to differentiate between 'I'm slow'
842 * and 'I don't know those channels'. */
843const u8 *handle_reply_short_channel_ids_end(struct peer *peer, const u8 *msg)
844{
845 struct bitcoin_blkid chain;
846 u8 complete;
847
848 if (!fromwire_reply_short_channel_ids_end(msg, &chain, &complete)) {
849 return towire_warningfmt(peer, NULL,
850 "Bad reply_short_channel_ids_end %s",
851 tal_hex(tmpctx, msg));
852 }
853
854 if (!bitcoin_blkid_eq(&chainparams->genesis_blockhash, &chain)) {
855 return towire_warningfmt(peer, NULL,
856 "reply_short_channel_ids_end for bad chain: %s",
857 tal_hex(tmpctx, msg));
858 }
859
860 if (!peer->scid_query_outstanding) {
861 return towire_warningfmt(peer, NULL,
862 "unexpected reply_short_channel_ids_end: %s",
863 tal_hex(tmpctx, msg));
864 }
865
866 peer->scid_query_outstanding = false;
867 if (peer->scid_query_cb)
868 peer->scid_query_cb(peer, complete);
869
870 /* All good, no error. */
871 return NULL;
872}
873
874/*~ Arbitrary ordering function of pubkeys.
875 *

Callers 1

handle_recv_gossipFunction · 0.85

Calls 2

tal_hexFunction · 0.85
towire_warningfmtFunction · 0.50

Tested by

no test coverage detected