wallet: Use `struct sha256` for payment_hash in `struct forwarding`

This commit is contained in:
trueptolemy 2019-08-10 16:13:40 +08:00 committed by ZmnSCPxj, ZmnSCPxj jxPCSmnZ
parent 5f6196a42d
commit 23bfdc307f
3 changed files with 4 additions and 5 deletions

View File

@ -120,8 +120,7 @@ void notify_forward_event(struct lightningd *ld,
cur->msat_out = AMOUNT_MSAT(0);
cur->fee = AMOUNT_MSAT(0);
}
cur->payment_hash = tal(cur, struct sha256_double);
cur->payment_hash->sha = in->payment_hash;
cur->payment_hash = tal_dup(cur, struct sha256, &in->payment_hash);
cur->status = state;
cur->failcode = failcode;
cur->received_time = in->received_time;

View File

@ -2851,8 +2851,8 @@ const struct forwarding *wallet_forwarded_payments_get(struct wallet *w,
}
if (sqlite3_column_type(stmt, 3) != SQLITE_NULL) {
cur->payment_hash = tal(ctx, struct sha256_double);
sqlite3_column_sha256_double(stmt, 3, cur->payment_hash);
cur->payment_hash = tal(ctx, struct sha256);
sqlite3_column_sha256(stmt, 3, cur->payment_hash);
} else {
cur->payment_hash = NULL;
}

View File

@ -190,7 +190,7 @@ static inline const char* forward_status_name(enum forward_status status)
struct forwarding {
struct short_channel_id channel_in, channel_out;
struct amount_msat msat_in, msat_out, fee;
struct sha256_double *payment_hash;
struct sha256 *payment_hash;
enum forward_status status;
enum onion_type failcode;
struct timeabs received_time;