@@ -466,9 +466,9 @@ func TestChannelZeroAddLocalHeight(t *testing.T) {
466466
467467 // Now Bob should fail the htlc back to Alice.
468468 // <----fail-----
469- err = bobChannel .FailHTLC (0 , []byte ("failreason" ), nil , nil , nil )
469+ err = bobChannel .FailHTLC (0 , []byte ("failreason" ), nil , nil , nil , nil )
470470 require .NoError (t , err )
471- err = aliceChannel .ReceiveFailHTLC (0 , []byte ("bad" ))
471+ err = aliceChannel .ReceiveFailHTLC (0 , []byte ("bad" ), nil )
472472 require .NoError (t , err )
473473
474474 // Bob should send a commitment signature to Alice.
@@ -2222,9 +2222,11 @@ func TestCancelHTLC(t *testing.T) {
22222222
22232223 // Now, with the HTLC committed on both sides, trigger a cancellation
22242224 // from Bob to Alice, removing the HTLC.
2225- err = bobChannel .FailHTLC (bobHtlcIndex , []byte ("failreason" ), nil , nil , nil )
2225+ err = bobChannel .FailHTLC (
2226+ bobHtlcIndex , []byte ("failreason" ), nil , nil , nil , nil ,
2227+ )
22262228 require .NoError (t , err , "unable to cancel HTLC" )
2227- err = aliceChannel .ReceiveFailHTLC (aliceHtlcIndex , []byte ("bad" ))
2229+ err = aliceChannel .ReceiveFailHTLC (aliceHtlcIndex , []byte ("bad" ), nil )
22282230 require .NoError (t , err , "unable to recv htlc cancel" )
22292231
22302232 // Now trigger another state transition, the HTLC should now be removed
@@ -5481,9 +5483,9 @@ func TestChanAvailableBandwidth(t *testing.T) {
54815483 }
54825484
54835485 htlcIndex := uint64 ((numHtlcs * 2 ) - 1 )
5484- err = bobChannel .FailHTLC (htlcIndex , []byte ("f" ), nil , nil , nil )
5486+ err = bobChannel .FailHTLC (htlcIndex , []byte ("f" ), nil , nil , nil , nil )
54855487 require .NoError (t , err , "unable to cancel HTLC" )
5486- err = aliceChannel .ReceiveFailHTLC (htlcIndex , []byte ("bad" ))
5488+ err = aliceChannel .ReceiveFailHTLC (htlcIndex , []byte ("bad" ), nil )
54875489 require .NoError (t , err , "unable to recv htlc cancel" )
54885490
54895491 // We must do a state transition before the balance is available
@@ -5937,9 +5939,11 @@ func TestLockedInHtlcForwardingSkipAfterRestart(t *testing.T) {
59375939
59385940 // With both nodes restarted, Bob will now attempt to cancel one of
59395941 // Alice's HTLC's.
5940- err = bobChannel .FailHTLC (htlc .ID , []byte ("failreason" ), nil , nil , nil )
5942+ err = bobChannel .FailHTLC (
5943+ htlc .ID , []byte ("failreason" ), nil , nil , nil , nil ,
5944+ )
59415945 require .NoError (t , err , "unable to cancel HTLC" )
5942- err = aliceChannel .ReceiveFailHTLC (htlc .ID , []byte ("bad" ))
5946+ err = aliceChannel .ReceiveFailHTLC (htlc .ID , []byte ("bad" ), nil )
59435947 require .NoError (t , err , "unable to recv htlc cancel" )
59445948
59455949 // We'll now initiate another state transition, but this time Bob will
@@ -5990,9 +5994,11 @@ func TestLockedInHtlcForwardingSkipAfterRestart(t *testing.T) {
59905994
59915995 // Failing the HTLC here will cause the update to be included in Alice's
59925996 // remote log, but it should not be committed by this transition.
5993- err = bobChannel .FailHTLC (htlc2 .ID , []byte ("failreason" ), nil , nil , nil )
5997+ err = bobChannel .FailHTLC (
5998+ htlc2 .ID , []byte ("failreason" ), nil , nil , nil , nil ,
5999+ )
59946000 require .NoError (t , err , "unable to cancel HTLC" )
5995- err = aliceChannel .ReceiveFailHTLC (htlc2 .ID , []byte ("bad" ))
6001+ err = aliceChannel .ReceiveFailHTLC (htlc2 .ID , []byte ("bad" ), nil )
59966002 require .NoError (t , err , "unable to recv htlc cancel" )
59976003
59986004 bobRevocation , _ , finalHtlcs , err := bobChannel .
@@ -6045,9 +6051,11 @@ func TestLockedInHtlcForwardingSkipAfterRestart(t *testing.T) {
60456051
60466052 // Re-add the Fail to both Alice and Bob's channels, as the non-committed
60476053 // update will not have survived the restart.
6048- err = bobChannel .FailHTLC (htlc2 .ID , []byte ("failreason" ), nil , nil , nil )
6054+ err = bobChannel .FailHTLC (
6055+ htlc2 .ID , []byte ("failreason" ), nil , nil , nil , nil ,
6056+ )
60496057 require .NoError (t , err , "unable to cancel HTLC" )
6050- err = aliceChannel .ReceiveFailHTLC (htlc2 .ID , []byte ("bad" ))
6058+ err = aliceChannel .ReceiveFailHTLC (htlc2 .ID , []byte ("bad" ), nil )
60516059 require .NoError (t , err , "unable to recv htlc cancel" )
60526060
60536061 // Have Alice initiate a state transition, which does not include the
@@ -6492,9 +6500,13 @@ func TestDesyncHTLCs(t *testing.T) {
64926500 }
64936501
64946502 // Now let Bob fail this HTLC.
6495- err = bobChannel .FailHTLC (bobIndex , []byte ("failreason" ), nil , nil , nil )
6503+ err = bobChannel .FailHTLC (
6504+ bobIndex , []byte ("failreason" ), nil , nil , nil , nil ,
6505+ )
64966506 require .NoError (t , err , "unable to cancel HTLC" )
6497- if err := aliceChannel .ReceiveFailHTLC (aliceIndex , []byte ("bad" )); err != nil {
6507+ if err := aliceChannel .ReceiveFailHTLC (
6508+ aliceIndex , []byte ("bad" ), nil ,
6509+ ); err != nil {
64986510 t .Fatalf ("unable to recv htlc cancel: %v" , err )
64996511 }
65006512
@@ -6584,10 +6596,12 @@ func TestMaxAcceptedHTLCs(t *testing.T) {
65846596
65856597 // Bob will fail the htlc specified by htlcID and then force a state
65866598 // transition.
6587- err = bobChannel .FailHTLC (htlcID , []byte {}, nil , nil , nil )
6599+ err = bobChannel .FailHTLC (htlcID , []byte {}, nil , nil , nil , nil )
65886600 require .NoError (t , err , "unable to fail htlc" )
65896601
6590- if err := aliceChannel .ReceiveFailHTLC (htlcID , []byte {}); err != nil {
6602+ if err := aliceChannel .ReceiveFailHTLC (
6603+ htlcID , []byte {}, nil ,
6604+ ); err != nil {
65916605 t .Fatalf ("unable to receive fail htlc: %v" , err )
65926606 }
65936607
@@ -6690,10 +6704,12 @@ func TestMaxAsynchronousHtlcs(t *testing.T) {
66906704 addAndReceiveHTLC (t , aliceChannel , bobChannel , htlc , nil )
66916705
66926706 // Fail back an HTLC and sign a commitment as in steps 1 & 2.
6693- err = bobChannel .FailHTLC (htlcID , []byte {}, nil , nil , nil )
6707+ err = bobChannel .FailHTLC (htlcID , []byte {}, nil , nil , nil , nil )
66946708 require .NoError (t , err , "unable to fail htlc" )
66956709
6696- if err := aliceChannel .ReceiveFailHTLC (htlcID , []byte {}); err != nil {
6710+ if err := aliceChannel .ReceiveFailHTLC (
6711+ htlcID , []byte {}, nil ,
6712+ ); err != nil {
66976713 t .Fatalf ("unable to receive fail htlc: %v" , err )
66986714 }
66996715
@@ -7518,10 +7534,10 @@ func TestChannelRestoreUpdateLogsFailedHTLC(t *testing.T) {
75187534 restoreAndAssert (t , aliceChannel , 1 , 0 , 0 , 0 )
75197535
75207536 // Now we make Bob fail this HTLC.
7521- err = bobChannel .FailHTLC (0 , []byte ("failreason" ), nil , nil , nil )
7537+ err = bobChannel .FailHTLC (0 , []byte ("failreason" ), nil , nil , nil , nil )
75227538 require .NoError (t , err , "unable to cancel HTLC" )
75237539
7524- err = aliceChannel .ReceiveFailHTLC (0 , []byte ("failreason" ))
7540+ err = aliceChannel .ReceiveFailHTLC (0 , []byte ("failreason" ), nil )
75257541 require .NoError (t , err , "unable to recv htlc cancel" )
75267542
75277543 // This Fail update should have been added to Alice's remote update log.
@@ -7604,19 +7620,23 @@ func TestDuplicateFailRejection(t *testing.T) {
76047620
76057621 // With the HTLC locked in, we'll now have Bob fail the HTLC back to
76067622 // Alice.
7607- err = bobChannel .FailHTLC (0 , []byte ("failreason" ), nil , nil , nil )
7623+ err = bobChannel .FailHTLC (0 , []byte ("failreason" ), nil , nil , nil , nil )
76087624 require .NoError (t , err , "unable to cancel HTLC" )
7609- if err := aliceChannel .ReceiveFailHTLC (0 , []byte ("bad" )); err != nil {
7625+ if err := aliceChannel .ReceiveFailHTLC (
7626+ 0 , []byte ("bad" ), nil ,
7627+ ); err != nil {
76107628 t .Fatalf ("unable to recv htlc cancel: %v" , err )
76117629 }
76127630
76137631 // If we attempt to fail it AGAIN, then both sides should reject this
76147632 // second failure attempt.
7615- err = bobChannel .FailHTLC (0 , []byte ("failreason" ), nil , nil , nil )
7633+ err = bobChannel .FailHTLC (0 , []byte ("failreason" ), nil , nil , nil , nil )
76167634 if err == nil {
76177635 t .Fatalf ("duplicate HTLC failure attempt should have failed" )
76187636 }
7619- if err := aliceChannel .ReceiveFailHTLC (0 , []byte ("bad" )); err == nil {
7637+ if err := aliceChannel .ReceiveFailHTLC (
7638+ 0 , []byte ("bad" ), nil ,
7639+ ); err == nil {
76207640 t .Fatalf ("duplicate HTLC failure attempt should have failed" )
76217641 }
76227642
@@ -7633,14 +7653,16 @@ func TestDuplicateFailRejection(t *testing.T) {
76337653 require .NoError (t , err , "unable to restart channel" )
76347654
76357655 // If we try to fail the same HTLC again, then we should get an error.
7636- err = bobChannel .FailHTLC (0 , []byte ("failreason" ), nil , nil , nil )
7656+ err = bobChannel .FailHTLC (0 , []byte ("failreason" ), nil , nil , nil , nil )
76377657 if err == nil {
76387658 t .Fatalf ("duplicate HTLC failure attempt should have failed" )
76397659 }
76407660
76417661 // Alice on the other hand should accept the failure again, as she
76427662 // dropped all items in the logs which weren't committed.
7643- if err := aliceChannel .ReceiveFailHTLC (0 , []byte ("bad" )); err != nil {
7663+ if err := aliceChannel .ReceiveFailHTLC (
7664+ 0 , []byte ("bad" ), nil ,
7665+ ); err != nil {
76447666 t .Fatalf ("unable to recv htlc cancel: %v" , err )
76457667 }
76467668}
@@ -7901,9 +7923,9 @@ func TestChannelRestoreCommitHeight(t *testing.T) {
79017923 bobChannel = restoreAndAssertCommitHeights (t , bobChannel , true , 1 , 2 , 2 )
79027924
79037925 // Bob now fails back the htlc that was just locked in.
7904- err = bobChannel .FailHTLC (0 , []byte ("failreason" ), nil , nil , nil )
7926+ err = bobChannel .FailHTLC (0 , []byte ("failreason" ), nil , nil , nil , nil )
79057927 require .NoError (t , err , "unable to cancel HTLC" )
7906- err = aliceChannel .ReceiveFailHTLC (0 , []byte ("bad" ))
7928+ err = aliceChannel .ReceiveFailHTLC (0 , []byte ("bad" ), nil )
79077929 require .NoError (t , err , "unable to recv htlc cancel" )
79087930
79097931 // Now Bob signs for the fail update.
@@ -9224,9 +9246,9 @@ func TestChannelUnsignedAckedFailure(t *testing.T) {
92249246
92259247 // Now Bob should fail the htlc back to Alice.
92269248 // <----fail-----
9227- err = bobChannel .FailHTLC (0 , []byte ("failreason" ), nil , nil , nil )
9249+ err = bobChannel .FailHTLC (0 , []byte ("failreason" ), nil , nil , nil , nil )
92289250 require .NoError (t , err )
9229- err = aliceChannel .ReceiveFailHTLC (0 , []byte ("bad" ))
9251+ err = aliceChannel .ReceiveFailHTLC (0 , []byte ("bad" ), nil )
92309252 require .NoError (t , err )
92319253
92329254 // Bob should send a commitment signature to Alice.
@@ -9328,9 +9350,9 @@ func TestChannelLocalUnsignedUpdatesFailure(t *testing.T) {
93289350
93299351 // Now Alice should fail the htlc back to Bob.
93309352 // -----fail--->
9331- err = aliceChannel .FailHTLC (0 , []byte ("failreason" ), nil , nil , nil )
9353+ err = aliceChannel .FailHTLC (0 , []byte ("failreason" ), nil , nil , nil , nil )
93329354 require .NoError (t , err )
9333- err = bobChannel .ReceiveFailHTLC (0 , []byte ("bad" ))
9355+ err = bobChannel .ReceiveFailHTLC (0 , []byte ("bad" ), nil )
93349356 require .NoError (t , err )
93359357
93369358 // Alice should send a commitment signature to Bob.
@@ -10773,10 +10795,10 @@ func TestAsynchronousSendingWithFeeBuffer(t *testing.T) {
1077310795 // <----rev------- |---------------
1077410796 // <----sig------- |---------------
1077510797 // --------------- |-----rev------>
10776- err = aliceChannel .FailHTLC (0 , []byte {}, nil , nil , nil )
10798+ err = aliceChannel .FailHTLC (0 , []byte {}, nil , nil , nil , nil )
1077710799 require .NoError (t , err )
1077810800
10779- err = bobChannel .ReceiveFailHTLC (0 , []byte {})
10801+ err = bobChannel .ReceiveFailHTLC (0 , []byte {}, nil )
1078010802 require .NoError (t , err )
1078110803
1078210804 err = ForceStateTransition (aliceChannel , bobChannel )
0 commit comments