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

Function extract_revocation_basepoint

connectd/multiplex.c:1108–1185  ·  view source on GitHub ↗

Only works for open_channel2 and accept_channel2 */

Source from the content-addressed store, hash-verified

1106
1107/* Only works for open_channel2 and accept_channel2 */
1108static struct pubkey *extract_revocation_basepoint(const tal_t *ctx,
1109 const u8 *msg)
1110{
1111 const u8 *cursor = msg;
1112 size_t max = tal_bytelen(msg);
1113 enum peer_wire t;
1114 struct pubkey pubkey;
1115
1116 t = fromwire_u16(&cursor, &max);
1117
1118 switch (t) {
1119 case WIRE_OPEN_CHANNEL2:
1120 /* BOLT #2:
1121 * 1. type: 64 (`open_channel2`)
1122 * 2. data:
1123 * * [`chain_hash`:`chain_hash`]
1124 * * [`channel_id`:`temporary_channel_id`]
1125 * * [`u32`:`funding_feerate_perkw`]
1126 * * [`u32`:`commitment_feerate_perkw`]
1127 * * [`u64`:`funding_satoshis`]
1128 * * [`u64`:`dust_limit_satoshis`]
1129 * * [`u64`:`max_htlc_value_in_flight_msat`]
1130 * * [`u64`:`htlc_minimum_msat`]
1131 * * [`u16`:`to_self_delay`]
1132 * * [`u16`:`max_accepted_htlcs`]
1133 * * [`u32`:`locktime`]
1134 * * [`point`:`funding_pubkey`]
1135 * * [`point`:`revocation_basepoint`]
1136 */
1137 fromwire_pad(&cursor, &max,
1138 sizeof(struct bitcoin_blkid)
1139 + sizeof(struct channel_id)
1140 + sizeof(u32)
1141 + sizeof(u32)
1142 + sizeof(u64)
1143 + sizeof(u64)
1144 + sizeof(u64)
1145 + sizeof(u64)
1146 + sizeof(u16)
1147 + sizeof(u16)
1148 + sizeof(u32)
1149 + PUBKEY_CMPR_LEN);
1150 break;
1151 case WIRE_ACCEPT_CHANNEL2:
1152 /* BOLT #2:
1153 * 1. type: 65 (`accept_channel2`)
1154 * 2. data:
1155 * * [`channel_id`:`temporary_channel_id`]
1156 * * [`u64`:`funding_satoshis`]
1157 * * [`u64`:`dust_limit_satoshis`]
1158 * * [`u64`:`max_htlc_value_in_flight_msat`]
1159 * * [`u64`:`htlc_minimum_msat`]
1160 * * [`u32`:`minimum_depth`]
1161 * * [`u16`:`to_self_delay`]
1162 * * [`u16`:`max_accepted_htlcs`]
1163 * * [`point`:`funding_pubkey`]
1164 * * [`point`:`revocation_basepoint`]
1165 */

Callers 2

update_v2_channelidFunction · 0.85
maybe_update_channelidFunction · 0.85

Calls 5

tal_bytelenFunction · 0.85
abortFunction · 0.85
fromwire_pubkeyFunction · 0.85
fromwire_u16Function · 0.50
fromwire_padFunction · 0.50

Tested by

no test coverage detected