Skip to content

Commit

Permalink
db_col_psbt: convert to PSBTv2 on load from db
Browse files Browse the repository at this point in the history
  • Loading branch information
instagibbs authored and rustyrussell committed May 25, 2023
1 parent 1037bf3 commit eec30b1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion db/bindings.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,12 +437,15 @@ struct bitcoin_tx *db_col_tx(const tal_t *ctx, struct db_stmt *stmt, const char

struct wally_psbt *db_col_psbt(const tal_t *ctx, struct db_stmt *stmt, const char *colname)
{
struct wally_psbt *psbt;
size_t col = db_query_colnum(stmt, colname);
const u8 *src = db_column_blob(stmt, col);
size_t len = db_column_bytes(stmt, col);

db_column_null_warn(stmt, colname, col);
return psbt_from_bytes(ctx, src, len);
psbt = psbt_from_bytes(ctx, src, len);
psbt_set_version(psbt, 2);
return psbt;
}

struct bitcoin_tx *db_col_psbt_to_tx(const tal_t *ctx, struct db_stmt *stmt, const char *colname)
Expand Down

0 comments on commit eec30b1

Please sign in to comment.