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

Function stub_chan

lightningd/opening_control.c:1515–1694  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1513}
1514
1515static struct channel *stub_chan(struct command *cmd,
1516 u64 id,
1517 struct node_id nodeid,
1518 struct channel_id cid,
1519 struct bitcoin_outpoint funding,
1520 struct wireaddr addr,
1521 struct amount_sat funding_sats,
1522 struct channel_type *type,
1523 struct shachain shachain,
1524 struct basepoints their_basepoint,
1525 enum side opener,
1526 u16 remote_to_self_delay)
1527{
1528 struct basepoints basepoints;
1529 struct bitcoin_signature *sig;
1530 struct channel *channel;
1531 struct channel_config *our_config;
1532 struct channel_config *their_config;
1533 struct channel_info *channel_info;
1534 struct lightningd *ld;
1535 struct peer *peer;
1536 struct pubkey localFundingPubkey;
1537 struct pubkey pk;
1538 struct short_channel_id scid;
1539 u32 blockht;
1540 u32 feerate;
1541 struct channel_stats zero_channel_stats;
1542 struct wallet_shachain *their_shachain = tal(cmd, struct wallet_shachain);
1543 their_shachain->chain = shachain;
1544 their_shachain->id = 0;
1545
1546 u8 *dummy_sig = tal_hexdata(cmd,
1547 "30450221009b2e0eef267b94c3899fb0dc73750"
1548 "12e2cee4c10348a068fe78d1b82b4b1403602207"
1549 "7c3fad3adac2ddf33f415e45f0daf6658b7a0b09"
1550 "647de4443938ae2dbafe2b9" "01",
1551 144);
1552
1553 /* If the channel is already stored, return NULL. */
1554 if (channel_exists_by_id(cmd->ld->wallet, id)) {
1555 log_debug(cmd->ld->log, "channel %s already exists!",
1556 fmt_channel_id(tmpctx, &cid));
1557 return NULL;
1558 }
1559
1560 peer = peer_by_id(cmd->ld, &nodeid);
1561 if (!peer) {
1562 struct wireaddr_internal wint;
1563
1564 wireaddr_internal_from_wireaddr(&wint, &addr);
1565 peer = new_peer(cmd->ld,
1566 0,
1567 &nodeid,
1568 &wint,
1569 &addr,
1570 NULL,
1571 false);
1572 }

Callers 1

json_recoverchannelFunction · 0.85

Calls 15

tal_hexdataFunction · 0.85
channel_exists_by_idFunction · 0.85
peer_by_idFunction · 0.85
signature_from_derFunction · 0.85
tal_bytelenFunction · 0.85
pubkey_from_derFunction · 0.85
fmt_node_idFunction · 0.85
mk_short_channel_idFunction · 0.85
new_fee_statesFunction · 0.85
new_height_statesFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected