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

Function stub_chan

lightningd/opening_control.c:1501–1680  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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