| 625 | } |
| 626 | |
| 627 | void db_col_outpoint(struct db_stmt *stmt, const char *colname, struct bitcoin_outpoint *o) |
| 628 | { |
| 629 | be32 be_vout; |
| 630 | size_t col = db_query_colnum(stmt, colname); |
| 631 | const u8 *raw; |
| 632 | assert(db_column_bytes(stmt, col) == sizeof(o->txid.shad.sha.u.u8) + sizeof(be32)); |
| 633 | raw = db_column_blob(stmt, col); |
| 634 | memcpy(o->txid.shad.sha.u.u8, raw, sizeof(o->txid.shad.sha.u.u8)); |
| 635 | memcpy(&be_vout, raw + sizeof(o->txid.shad.sha.u.u8), sizeof(be_vout)); |
| 636 | o->n = be32_to_cpu(be_vout); |
| 637 | } |
| 638 | |
| 639 | struct onionreply *db_col_onionreply(const tal_t *ctx, |
| 640 | struct db_stmt *stmt, const char *colname) |
no test coverage detected