diff --git a/lightningd/htlc_end.h b/lightningd/htlc_end.h index 73e1d3d37..9a502d2cc 100644 --- a/lightningd/htlc_end.h +++ b/lightningd/htlc_end.h @@ -47,6 +47,7 @@ struct htlc_out { * is saved to the database, must be >0 after saving to the * database. */ u64 dbid; + u64 origin_htlc_id; struct htlc_key key; u64 msatoshi; u32 cltv_expiry; diff --git a/wallet/wallet.c b/wallet/wallet.c index 91a379436..08d81d3b6 100644 --- a/wallet/wallet.c +++ b/wallet/wallet.c @@ -884,6 +884,7 @@ bool wallet_htlc_save_out(struct wallet *wallet, /* We absolutely need the incoming HTLC to be persisted before * we can persist it's dependent */ assert(out->in == NULL || out->in->dbid != 0); + out->origin_htlc_id = out->in?out->in->dbid:0; ok &= db_exec( __func__, wallet->db,