@@ -2174,19 +2174,23 @@ static bool test_htlc_crud(struct lightningd *ld, const tal_t *ctx)
2174
2174
chan -> state = CHANNELD_NORMAL ;
2175
2175
chan -> peer = peer ;
2176
2176
chan -> next_index [LOCAL ] = chan -> next_index [REMOTE ] = 1 ;
2177
+ chan -> scid = tal (chan , struct short_channel_id );
2177
2178
2178
2179
memset (& in , 0 , sizeof (in ));
2179
2180
memset (& out , 0 , sizeof (out ));
2180
2181
memset (& in .payment_hash , 'A' , sizeof (struct sha256 ));
2181
2182
memset (& out .payment_hash , 'A' , sizeof (struct sha256 ));
2182
2183
memset (& payment_key , 'B' , sizeof (payment_key ));
2184
+ assert (mk_short_channel_id (chan -> scid , 1 , 2 , 3 ));
2183
2185
in .key .id = 42 ;
2184
2186
in .key .channel = chan ;
2187
+ in .cltv_expiry = 42 ;
2185
2188
in .msat = AMOUNT_MSAT (42 );
2186
2189
2187
2190
out .in = & in ;
2188
2191
out .key .id = 1337 ;
2189
2192
out .key .channel = chan ;
2193
+ out .cltv_expiry = 41 ;
2190
2194
out .msat = AMOUNT_MSAT (41 );
2191
2195
2192
2196
/* Store the htlc_in */
@@ -2200,17 +2204,17 @@ static bool test_htlc_crud(struct lightningd *ld, const tal_t *ctx)
2200
2204
wallet_err = tal_free (wallet_err );
2201
2205
2202
2206
/* Update */
2203
- CHECK_MSG (transaction_wrap (w -> db , wallet_htlc_update (w , in .dbid , RCVD_ADD_HTLC , NULL , 0 , 0 , NULL , NULL , & we_filled )),
2207
+ CHECK_MSG (transaction_wrap (w -> db , wallet_htlc_update (w , in .dbid , RCVD_ADD_HTLC , NULL , 0 , 0 , NULL , NULL , & we_filled , in . key . id , in . key . channel , REMOTE , & in . payment_hash , in . cltv_expiry , in . msat )),
2204
2208
"Update HTLC with null payment_key failed" );
2205
2209
CHECK_MSG (
2206
- transaction_wrap (w -> db , wallet_htlc_update (w , in .dbid , SENT_REMOVE_HTLC , & payment_key , 0 , 0 , NULL , NULL , & we_filled )),
2210
+ transaction_wrap (w -> db , wallet_htlc_update (w , in .dbid , SENT_REMOVE_HTLC , & payment_key , 0 , 0 , NULL , NULL , & we_filled , in . key . id , in . key . channel , REMOTE , & in . payment_hash , in . cltv_expiry , in . msat )),
2207
2211
"Update HTLC with payment_key failed" );
2208
2212
onionreply = new_onionreply (tmpctx , tal_arrz (tmpctx , u8 , 100 ));
2209
2213
CHECK_MSG (
2210
- transaction_wrap (w -> db , wallet_htlc_update (w , in .dbid , SENT_REMOVE_HTLC , NULL , 0 , 0 , onionreply , NULL , & we_filled )),
2214
+ transaction_wrap (w -> db , wallet_htlc_update (w , in .dbid , SENT_REMOVE_HTLC , NULL , 0 , 0 , onionreply , NULL , & we_filled , in . key . id , in . key . channel , REMOTE , & in . payment_hash , in . cltv_expiry , in . msat )),
2211
2215
"Update HTLC with failonion failed" );
2212
2216
CHECK_MSG (
2213
- transaction_wrap (w -> db , wallet_htlc_update (w , in .dbid , SENT_REMOVE_HTLC , NULL , 0 , WIRE_INVALID_ONION_VERSION , NULL , NULL , & we_filled )),
2217
+ transaction_wrap (w -> db , wallet_htlc_update (w , in .dbid , SENT_REMOVE_HTLC , NULL , 0 , WIRE_INVALID_ONION_VERSION , NULL , NULL , & we_filled , in . key . id , in . key . channel , REMOTE , & in . payment_hash , in . cltv_expiry , in . msat )),
2214
2218
"Update HTLC with failcode failed" );
2215
2219
2216
2220
CHECK_MSG (transaction_wrap (w -> db , wallet_htlc_save_out (w , chan , & out )),
@@ -2222,7 +2226,7 @@ static bool test_htlc_crud(struct lightningd *ld, const tal_t *ctx)
2222
2226
CHECK (wallet_err );
2223
2227
wallet_err = tal_free (wallet_err );
2224
2228
CHECK_MSG (
2225
- transaction_wrap (w -> db , wallet_htlc_update (w , out .dbid , SENT_ADD_ACK_REVOCATION , NULL , 0 , 0 , NULL , tal_arrz (tmpctx , u8 , 100 ), & we_filled )),
2229
+ transaction_wrap (w -> db , wallet_htlc_update (w , out .dbid , SENT_ADD_ACK_REVOCATION , NULL , 0 , 0 , NULL , tal_arrz (tmpctx , u8 , 100 ), & we_filled , out . key . id , out . key . channel , REMOTE , & out . payment_hash , out . cltv_expiry , out . msat )),
2226
2230
"Update outgoing HTLC with failmsg failed" );
2227
2231
2228
2232
/* Attempt to load them from the DB again */
0 commit comments