FIXME: We could adapt tools/generate-wire.py to generate structures * and code like this. */
| 93 | /* FIXME: We could adapt tools/generate-wire.py to generate structures |
| 94 | * and code like this. */ |
| 95 | void towire_added_htlc(u8 **pptr, const struct added_htlc *added) |
| 96 | { |
| 97 | towire_u64(pptr, added->id); |
| 98 | towire_amount_msat(pptr, added->amount); |
| 99 | towire_sha256(pptr, &added->payment_hash); |
| 100 | towire_u32(pptr, added->cltv_expiry); |
| 101 | towire(pptr, added->onion_routing_packet, |
| 102 | sizeof(added->onion_routing_packet)); |
| 103 | if (added->path_key) { |
| 104 | towire_bool(pptr, true); |
| 105 | towire_pubkey(pptr, added->path_key); |
| 106 | } else |
| 107 | towire_bool(pptr, false); |
| 108 | if (added->extra_tlvs) { |
| 109 | towire_bool(pptr, true); |
| 110 | towire_len_and_tlvstream(pptr, added->extra_tlvs); |
| 111 | } else |
| 112 | towire_bool(pptr, false); |
| 113 | towire_bool(pptr, added->fail_immediate); |
| 114 | } |
| 115 | |
| 116 | void towire_existing_htlc(u8 **pptr, const struct existing_htlc *existing) |
| 117 | { |
nothing calls this directly
no test coverage detected