@ -1316,15 +1316,18 @@ static bool test_htlc_crud(struct lightningd *ld, const tal_t *ctx)
wallet_err = tal_free ( wallet_err ) ;
wallet_err = tal_free ( wallet_err ) ;
/* Update */
/* Update */
CHECK_MSG ( transaction_wrap ( w - > db , wallet_htlc_update ( w , in . dbid , RCVD_ADD_HTLC , NULL , 0 , NULL ) ) ,
CHECK_MSG ( transaction_wrap ( w - > db , wallet_htlc_update ( w , in . dbid , RCVD_ADD_HTLC , NULL , 0 , NULL , NULL ) ) ,
" Update HTLC with null payment_key failed " ) ;
" Update HTLC with null payment_key failed " ) ;
CHECK_MSG (
CHECK_MSG (
transaction_wrap ( w - > db , wallet_htlc_update ( w , in . dbid , SENT_REMOVE_HTLC , & payment_key , 0 , NULL ) ) ,
transaction_wrap ( w - > db , wallet_htlc_update ( w , in . dbid , SENT_REMOVE_HTLC , & payment_key , 0 , NULL , NULL ) ) ,
" Update HTLC with payment_key failed " ) ;
" Update HTLC with payment_key failed " ) ;
onionreply = new_onionreply ( tmpctx , tal_arrz ( tmpctx , u8 , 100 ) ) ;
onionreply = new_onionreply ( tmpctx , tal_arrz ( tmpctx , u8 , 100 ) ) ;
CHECK_MSG (
CHECK_MSG (
transaction_wrap ( w - > db , wallet_htlc_update ( w , in . dbid , SENT_REMOVE_HTLC , NULL , 0 , onionreply ) ) ,
transaction_wrap ( w - > db , wallet_htlc_update ( w , in . dbid , SENT_REMOVE_HTLC , NULL , 0 , onionreply , NULL ) ) ,
" Update HTLC with failreason failed " ) ;
" Update HTLC with failonion failed " ) ;
CHECK_MSG (
transaction_wrap ( w - > db , wallet_htlc_update ( w , in . dbid , SENT_REMOVE_HTLC , NULL , 0x2002 , NULL , NULL ) ) ,
" Update HTLC with failcode failed " ) ;
CHECK_MSG ( transaction_wrap ( w - > db , wallet_htlc_save_out ( w , chan , & out ) ) ,
CHECK_MSG ( transaction_wrap ( w - > db , wallet_htlc_save_out ( w , chan , & out ) ) ,
tal_fmt ( ctx , " Save htlc_out failed: %s " , wallet_err ) ) ;
tal_fmt ( ctx , " Save htlc_out failed: %s " , wallet_err ) ) ;
@ -1334,6 +1337,9 @@ static bool test_htlc_crud(struct lightningd *ld, const tal_t *ctx)
" Saving two HTLCs with the same data must not succeed. " ) ;
" Saving two HTLCs with the same data must not succeed. " ) ;
CHECK ( wallet_err ) ;
CHECK ( wallet_err ) ;
wallet_err = tal_free ( wallet_err ) ;
wallet_err = tal_free ( wallet_err ) ;
CHECK_MSG (
transaction_wrap ( w - > db , wallet_htlc_update ( w , out . dbid , SENT_ADD_ACK_REVOCATION , NULL , 0 , NULL , tal_arrz ( tmpctx , u8 , 100 ) ) ) ,
" Update outgoing HTLC with failmsg failed " ) ;
/* Attempt to load them from the DB again */
/* Attempt to load them from the DB again */
htlc_in_map_init ( htlcs_in ) ;
htlc_in_map_init ( htlcs_in ) ;