@@ -57,21 +57,32 @@ func testEndorsement(ht *lntest.HarnessTest, aliceEndorse bool) {
5757 FeeLimitMsat : math .MaxInt64 ,
5858 }
5959
60- expectedValue := []byte {lnwire .ExperimentalUnendorsed }
61- if aliceEndorse {
62- expectedValue = []byte {lnwire .ExperimentalEndorsed }
63- t := uint64 (lnwire .ExperimentalEndorsementType )
64- sendReq .FirstHopCustomRecords = map [uint64 ][]byte {
65- t : expectedValue ,
60+ var expectedValue []byte
61+ hasEndorsement := lntest .ExperimentalEndorsementActive ()
62+
63+ if hasEndorsement {
64+ if aliceEndorse {
65+ expectedValue = []byte {lnwire .ExperimentalEndorsed }
66+ t := uint64 (lnwire .ExperimentalEndorsementType )
67+ sendReq .FirstHopCustomRecords = map [uint64 ][]byte {
68+ t : expectedValue ,
69+ }
70+ } else {
71+ expectedValue = []byte {lnwire .ExperimentalUnendorsed }
6672 }
6773 }
6874
6975 _ = alice .RPC .SendPayment (sendReq )
7076
7177 // Validate that our signal (positive or zero) propagates until carol
7278 // and then is dropped because she has disabled the feature.
73- validateEndorsedAndResume (ht , bobIntercept , true , expectedValue )
74- validateEndorsedAndResume (ht , carolIntercept , true , expectedValue )
79+ // When the endorsement experiment is not active, no signal is sent.
80+ validateEndorsedAndResume (
81+ ht , bobIntercept , hasEndorsement , expectedValue ,
82+ )
83+ validateEndorsedAndResume (
84+ ht , carolIntercept , hasEndorsement , expectedValue ,
85+ )
7586 validateEndorsedAndResume (ht , daveIntercept , false , nil )
7687
7788 var preimage lntypes.Preimage
0 commit comments