mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-23 15:04:19 +01:00
db/bindings: rename db_bind_short_channel_id to db_bind_short_channel_id_str, add db_bind_scid.
Although it's deprecated already (because it stores as string), it's better to make the name explicit. And create a new helper which stores as BIGINT. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
63457229cb
commit
33a6b18891
@@ -159,13 +159,19 @@ void db_bind_pubkey(struct db_stmt *stmt, int pos, const struct pubkey *pk)
|
||||
db_bind_blob(stmt, pos, der, PUBKEY_CMPR_LEN);
|
||||
}
|
||||
|
||||
void db_bind_short_channel_id(struct db_stmt *stmt, int col,
|
||||
const struct short_channel_id *id)
|
||||
void db_bind_short_channel_id_str(struct db_stmt *stmt, int col,
|
||||
const struct short_channel_id *id)
|
||||
{
|
||||
char *ser = short_channel_id_to_str(stmt, id);
|
||||
db_bind_text(stmt, col, ser);
|
||||
}
|
||||
|
||||
void db_bind_scid(struct db_stmt *stmt, int col,
|
||||
const struct short_channel_id *id)
|
||||
{
|
||||
db_bind_u64(stmt, col, id->u64);
|
||||
}
|
||||
|
||||
void db_bind_short_channel_id_arr(struct db_stmt *stmt, int col,
|
||||
const struct short_channel_id *id)
|
||||
{
|
||||
@@ -373,6 +379,12 @@ bool db_col_short_channel_id_str(struct db_stmt *stmt, const char *colname,
|
||||
return short_channel_id_from_str(source, sourcelen, dest);
|
||||
}
|
||||
|
||||
void db_col_scid(struct db_stmt *stmt, const char *colname,
|
||||
struct short_channel_id *dest)
|
||||
{
|
||||
dest->u64 = db_col_u64(stmt, colname);
|
||||
}
|
||||
|
||||
struct short_channel_id *
|
||||
db_col_short_channel_id_arr(const tal_t *ctx, struct db_stmt *stmt, const char *colname)
|
||||
{
|
||||
|
||||
@@ -37,8 +37,11 @@ void db_bind_node_id(struct db_stmt *stmt, int pos, const struct node_id *ni);
|
||||
void db_bind_node_id_arr(struct db_stmt *stmt, int col,
|
||||
const struct node_id *ids);
|
||||
void db_bind_pubkey(struct db_stmt *stmt, int pos, const struct pubkey *p);
|
||||
void db_bind_short_channel_id(struct db_stmt *stmt, int col,
|
||||
const struct short_channel_id *id);
|
||||
/* DO NOT USE, deprecated! */
|
||||
void db_bind_short_channel_id_str(struct db_stmt *stmt, int col,
|
||||
const struct short_channel_id *id);
|
||||
void db_bind_scid(struct db_stmt *stmt, int col,
|
||||
const struct short_channel_id *id);
|
||||
void db_bind_short_channel_id_arr(struct db_stmt *stmt, int col,
|
||||
const struct short_channel_id *id);
|
||||
void db_bind_signature(struct db_stmt *stmt, int col,
|
||||
@@ -83,8 +86,11 @@ struct node_id *db_col_node_id_arr(const tal_t *ctx, struct db_stmt *stmt,
|
||||
const char *colname);
|
||||
void db_col_pubkey(struct db_stmt *stmt, const char *colname,
|
||||
struct pubkey *p);
|
||||
/* DO NOT USE: deprecated */
|
||||
bool db_col_short_channel_id_str(struct db_stmt *stmt, const char *colname,
|
||||
struct short_channel_id *dest);
|
||||
void db_col_scid(struct db_stmt *stmt, const char *colname,
|
||||
struct short_channel_id *dest);
|
||||
struct short_channel_id *
|
||||
db_col_short_channel_id_arr(const tal_t *ctx, struct db_stmt *stmt, const char *colname);
|
||||
bool db_col_signature(struct db_stmt *stmt, const char *colname,
|
||||
|
||||
Reference in New Issue
Block a user