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

Function stub_chan

lightningd/opening_control.c:1520–1699  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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