Only works for open_channel2 and accept_channel2 */
| 779 | |
| 780 | /* Only works for open_channel2 and accept_channel2 */ |
| 781 | static struct pubkey *extract_revocation_basepoint(const tal_t *ctx, |
| 782 | const u8 *msg) |
| 783 | { |
| 784 | const u8 *cursor = msg; |
| 785 | size_t max = tal_bytelen(msg); |
| 786 | enum peer_wire t; |
| 787 | struct pubkey pubkey; |
| 788 | |
| 789 | t = fromwire_u16(&cursor, &max); |
| 790 | |
| 791 | switch (t) { |
| 792 | case WIRE_OPEN_CHANNEL2: |
| 793 | /* BOLT-dualfund #2: |
| 794 | * 1. type: 64 (`open_channel2`) |
| 795 | * 2. data: |
| 796 | * * [`chain_hash`:`chain_hash`] |
| 797 | * * [`channel_id`:`zerod_channel_id`] |
| 798 | * * [`u32`:`funding_feerate_perkw`] |
| 799 | * * [`u32`:`commitment_feerate_perkw`] |
| 800 | * * [`u64`:`funding_satoshis`] |
| 801 | * * [`u64`:`dust_limit_satoshis`] |
| 802 | * * [`u64`:`max_htlc_value_in_flight_msat`] |
| 803 | * * [`u64`:`htlc_minimum_msat`] |
| 804 | * * [`u16`:`to_self_delay`] |
| 805 | * * [`u16`:`max_accepted_htlcs`] |
| 806 | * * [`u32`:`locktime`] |
| 807 | * * [`point`:`funding_pubkey`] |
| 808 | * * [`point`:`revocation_basepoint`] |
| 809 | */ |
| 810 | fromwire_pad(&cursor, &max, |
| 811 | sizeof(struct bitcoin_blkid) |
| 812 | + sizeof(struct channel_id) |
| 813 | + sizeof(u32) |
| 814 | + sizeof(u32) |
| 815 | + sizeof(u64) |
| 816 | + sizeof(u64) |
| 817 | + sizeof(u64) |
| 818 | + sizeof(u64) |
| 819 | + sizeof(u16) |
| 820 | + sizeof(u16) |
| 821 | + sizeof(u32) |
| 822 | + PUBKEY_CMPR_LEN); |
| 823 | break; |
| 824 | case WIRE_ACCEPT_CHANNEL2: |
| 825 | /* BOLT-dualfund #2: |
| 826 | * 1. type: 65 (`accept_channel2`) |
| 827 | * 2. data: |
| 828 | * * [`channel_id`:`zerod_channel_id`] |
| 829 | * * [`u64`:`funding_satoshis`] |
| 830 | * * [`u64`:`dust_limit_satoshis`] |
| 831 | * * [`u64`:`max_htlc_value_in_flight_msat`] |
| 832 | * * [`u64`:`htlc_minimum_msat`] |
| 833 | * * [`u32`:`minimum_depth`] |
| 834 | * * [`u16`:`to_self_delay`] |
| 835 | * * [`u16`:`max_accepted_htlcs`] |
| 836 | * * [`point`:`funding_pubkey`] |
| 837 | * * [`point`:`revocation_basepoint`] |
| 838 | */ |
no test coverage detected