MCPcopy Create free account
hub / github.com/ElementsProject/lightning / db_col_outpoint

Function db_col_outpoint

db/bindings.c:627–637  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

625}
626
627void 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
639struct onionreply *db_col_onionreply(const tal_t *ctx,
640 struct db_stmt *stmt, const char *colname)

Calls 4

db_query_colnumFunction · 0.85
db_column_bytesFunction · 0.85
db_column_blobFunction · 0.85
be32_to_cpuFunction · 0.85

Tested by

no test coverage detected