mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-17 19:03:42 +01:00
invoices: Use common code for loading r and rhash.
This commit is contained in:
parent
978e5c67d8
commit
efc5da9ad4
@ -96,11 +96,9 @@ static void wallet_stmt2invoice_details(const tal_t *ctx,
|
||||
{
|
||||
dtl->state = sqlite3_column_int(stmt, 0);
|
||||
|
||||
assert(sqlite3_column_bytes(stmt, 1) == sizeof(struct preimage));
|
||||
memcpy(&dtl->r, sqlite3_column_blob(stmt, 1), sqlite3_column_bytes(stmt, 1));
|
||||
sqlite3_column_preimage(stmt, 1, &dtl->r);
|
||||
|
||||
assert(sqlite3_column_bytes(stmt, 2) == sizeof(struct sha256));
|
||||
memcpy(&dtl->rhash, sqlite3_column_blob(stmt, 2), sqlite3_column_bytes(stmt, 2));
|
||||
sqlite3_column_sha256(stmt, 2, &dtl->rhash);
|
||||
|
||||
dtl->label = tal_strndup(ctx, sqlite3_column_blob(stmt, 3), sqlite3_column_bytes(stmt, 3));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user