Browse Source

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

pull/2938/head
trueptolemy 5 years ago
committed by ZmnSCPxj, ZmnSCPxj jxPCSmnZ
parent
commit
23bfdc307f
  1. 3
      lightningd/notification.c
  2. 4
      wallet/wallet.c
  3. 2
      wallet/wallet.h

3
lightningd/notification.c

@ -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;

4
wallet/wallet.c

@ -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;
}

2
wallet/wallet.h

@ -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;

Loading…
Cancel
Save