| 6550 | } |
| 6551 | |
| 6552 | struct wallet_htlc_iter *wallet_htlcs_next(struct wallet *w, |
| 6553 | struct wallet_htlc_iter *iter, |
| 6554 | struct short_channel_id *scid, |
| 6555 | u64 *htlc_id, |
| 6556 | int *cltv_expiry, |
| 6557 | enum side *owner, |
| 6558 | struct amount_msat *msat, |
| 6559 | struct sha256 *payment_hash, |
| 6560 | enum htlc_state *hstate, |
| 6561 | u64 *created_index, |
| 6562 | u64 *updated_index) |
| 6563 | { |
| 6564 | if (!db_step(iter->stmt)) |
| 6565 | return tal_free(iter); |
| 6566 | |
| 6567 | if (iter->scid.u64 != 0) |
| 6568 | *scid = iter->scid; |
| 6569 | else { |
| 6570 | if (db_col_is_null(iter->stmt, "channels.scid")) |
| 6571 | *scid = db_col_short_channel_id(iter->stmt, "channels.alias_local"); |
| 6572 | else { |
| 6573 | *scid = db_col_short_channel_id(iter->stmt, "channels.scid"); |
| 6574 | db_col_ignore(iter->stmt, "channels.alias_local"); |
| 6575 | } |
| 6576 | } |
| 6577 | *htlc_id = db_col_u64(iter->stmt, "h.channel_htlc_id"); |
| 6578 | if (db_col_int(iter->stmt, "h.direction") == DIRECTION_INCOMING) |
| 6579 | *owner = REMOTE; |
| 6580 | else |
| 6581 | *owner = LOCAL; |
| 6582 | *msat = db_col_amount_msat(iter->stmt, "h.msatoshi"); |
| 6583 | db_col_sha256(iter->stmt, "h.payment_hash", payment_hash); |
| 6584 | *cltv_expiry = db_col_int(iter->stmt, "h.cltv_expiry"); |
| 6585 | *hstate = db_col_int(iter->stmt, "h.hstate"); |
| 6586 | *created_index = db_col_u64(iter->stmt, "h.id"); |
| 6587 | *updated_index = db_col_u64(iter->stmt, "h.updated_index"); |
| 6588 | return iter; |
| 6589 | } |
| 6590 | |
| 6591 | u64 wallet_get_rune_next_unique_id(const tal_t *ctx, struct wallet *wallet) |
| 6592 | { |
no test coverage detected