| 114 | } |
| 115 | |
| 116 | void towire_existing_htlc(u8 **pptr, const struct existing_htlc *existing) |
| 117 | { |
| 118 | towire_u8(pptr, existing->state); |
| 119 | towire_u64(pptr, existing->id); |
| 120 | towire_amount_msat(pptr, existing->amount); |
| 121 | towire_sha256(pptr, &existing->payment_hash); |
| 122 | towire_u32(pptr, existing->cltv_expiry); |
| 123 | towire(pptr, existing->onion_routing_packet, |
| 124 | sizeof(existing->onion_routing_packet)); |
| 125 | if (existing->payment_preimage) { |
| 126 | towire_bool(pptr, true); |
| 127 | towire_preimage(pptr, existing->payment_preimage); |
| 128 | } else |
| 129 | towire_bool(pptr, false); |
| 130 | if (existing->failed) { |
| 131 | towire_bool(pptr, true); |
| 132 | towire_failed_htlc(pptr, existing->failed); |
| 133 | } else |
| 134 | towire_bool(pptr, false); |
| 135 | if (existing->path_key) { |
| 136 | towire_bool(pptr, true); |
| 137 | towire_pubkey(pptr, existing->path_key); |
| 138 | } else |
| 139 | towire_bool(pptr, false); |
| 140 | if (existing->extra_tlvs) { |
| 141 | towire_bool(pptr, true); |
| 142 | towire_len_and_tlvstream(pptr, existing->extra_tlvs); |
| 143 | } else |
| 144 | towire_bool(pptr, false); |
| 145 | } |
| 146 | |
| 147 | void towire_fulfilled_htlc(u8 **pptr, const struct fulfilled_htlc *fulfilled) |
| 148 | { |
nothing calls this directly
no test coverage detected