diff --git a/bitcoin/short_channel_id.h b/bitcoin/short_channel_id.h index 9145c2f8e..a4ec16e12 100644 --- a/bitcoin/short_channel_id.h +++ b/bitcoin/short_channel_id.h @@ -50,13 +50,13 @@ static inline u16 short_channel_id_outnum(const struct short_channel_id *scid) void mk_short_channel_id(struct short_channel_id *scid, u32 blocknum, u32 txnum, u16 outnum); -bool short_channel_id_from_str(const char *str, size_t strlen, - struct short_channel_id *dst); +bool WARN_UNUSED_RESULT short_channel_id_from_str(const char *str, size_t strlen, + struct short_channel_id *dst); char *short_channel_id_to_str(const tal_t *ctx, const struct short_channel_id *scid); -bool short_channel_id_dir_from_str(const char *str, size_t strlen, - struct short_channel_id_dir *scidd); +bool WARN_UNUSED_RESULT short_channel_id_dir_from_str(const char *str, size_t strlen, + struct short_channel_id_dir *scidd); char *short_channel_id_dir_to_str(const tal_t *ctx, const struct short_channel_id_dir *scidd); diff --git a/wallet/db.h b/wallet/db.h index 71faac6ff..2ec3b692e 100644 --- a/wallet/db.h +++ b/wallet/db.h @@ -134,8 +134,8 @@ void *sqlite3_column_arr_(const tal_t *ctx, sqlite3_stmt *stmt, int col, bool sqlite3_bind_short_channel_id(sqlite3_stmt *stmt, int col, const struct short_channel_id *id); -bool sqlite3_column_short_channel_id(sqlite3_stmt *stmt, int col, - struct short_channel_id *dest); +WARN_UNUSED_RESULT bool sqlite3_column_short_channel_id(sqlite3_stmt *stmt, int col, + struct short_channel_id *dest); bool sqlite3_bind_short_channel_id_array(sqlite3_stmt *stmt, int col, const struct short_channel_id *id); struct short_channel_id * diff --git a/wallet/wallet.c b/wallet/wallet.c index 4d506d62e..068fbb253 100644 --- a/wallet/wallet.c +++ b/wallet/wallet.c @@ -594,7 +594,8 @@ static struct channel *wallet_stmt2channel(const tal_t *ctx, struct wallet *w, s if (sqlite3_column_type(stmt, 2) != SQLITE_NULL) { scid = tal(tmpctx, struct short_channel_id); - sqlite3_column_short_channel_id(stmt, 2, scid); + if (!sqlite3_column_short_channel_id(stmt, 2, scid)) + return NULL; } else { scid = NULL; }