| 1859 | } |
| 1860 | |
| 1861 | static void payment_add_blindedpath(const tal_t *ctx, |
| 1862 | struct createonion_hop *hops, |
| 1863 | const struct blinded_path *bpath, |
| 1864 | struct amount_msat our_amt, |
| 1865 | struct amount_msat final_amt, |
| 1866 | u32 final_cltv) |
| 1867 | { |
| 1868 | /* It's a bit of a weird API for us, so we convert it back to |
| 1869 | * the struct tlv_payload */ |
| 1870 | u8 **tlvs = blinded_onion_hops(tmpctx, final_amt, final_cltv, |
| 1871 | final_amt, bpath); |
| 1872 | |
| 1873 | for (size_t i = 0; i < tal_count(tlvs); i++) { |
| 1874 | const u8 *cursor = tlvs[i]; |
| 1875 | size_t max = tal_bytelen(tlvs[i]); |
| 1876 | /* First one has to use real node_id */ |
| 1877 | if (i == 0) { |
| 1878 | assert(bpath->first_node_id.is_pubkey); |
| 1879 | node_id_from_pubkey(&hops[i].pubkey, |
| 1880 | &bpath->first_node_id.pubkey); |
| 1881 | } else { |
| 1882 | node_id_from_pubkey(&hops[i].pubkey, |
| 1883 | &bpath->path[i]->blinded_node_id); |
| 1884 | } |
| 1885 | |
| 1886 | /* Length is prepended, discard that first! */ |
| 1887 | fromwire_bigsize(&cursor, &max); |
| 1888 | hops[i].tlv_payload = fromwire_tlv_payload(ctx, &cursor, &max); |
| 1889 | } |
| 1890 | } |
| 1891 | |
| 1892 | static struct command_result *payment_compute_onion_payloads(struct payment *p) |
| 1893 | { |
no test coverage detected