8686 "2cf4f0731da13b8546d1d6d4f8d75b9fce6c2341a71b0ea6f780" +
8787 "df54bfdb0dd5cd9855179f602f917265f21f9190c70217774a6f" +
8888 "baaa7d63ad64199f4664813b955cff954949076dcf"
89+
90+ testLegacyRouteNumHops = 20
8991)
9092
9193func newTestRoute (numHops int ) ([]* Router , * PaymentPath , * []HopData , * OnionPacket , error ) {
@@ -214,7 +216,7 @@ func TestBolt4Packet(t *testing.T) {
214216}
215217
216218func TestSphinxCorrectness (t * testing.T ) {
217- nodes , _ , hopDatas , fwdMsg , err := newTestRoute (NumMaxHops )
219+ nodes , _ , hopDatas , fwdMsg , err := newTestRoute (testLegacyRouteNumHops )
218220 if err != nil {
219221 t .Fatalf ("unable to create random onion packet: %v" , err )
220222 }
@@ -307,7 +309,7 @@ func TestSphinxSingleHop(t *testing.T) {
307309func TestSphinxNodeRelpay (t * testing.T ) {
308310 // We'd like to ensure that the sphinx node itself rejects all replayed
309311 // packets which share the same shared secret.
310- nodes , _ , _ , fwdMsg , err := newTestRoute (NumMaxHops )
312+ nodes , _ , _ , fwdMsg , err := newTestRoute (testLegacyRouteNumHops )
311313 if err != nil {
312314 t .Fatalf ("unable to create test route: %v" , err )
313315 }
@@ -332,7 +334,7 @@ func TestSphinxNodeRelpay(t *testing.T) {
332334func TestSphinxNodeRelpaySameBatch (t * testing.T ) {
333335 // We'd like to ensure that the sphinx node itself rejects all replayed
334336 // packets which share the same shared secret.
335- nodes , _ , _ , fwdMsg , err := newTestRoute (NumMaxHops )
337+ nodes , _ , _ , fwdMsg , err := newTestRoute (testLegacyRouteNumHops )
336338 if err != nil {
337339 t .Fatalf ("unable to create test route: %v" , err )
338340 }
@@ -378,7 +380,7 @@ func TestSphinxNodeRelpaySameBatch(t *testing.T) {
378380func TestSphinxNodeRelpayLaterBatch (t * testing.T ) {
379381 // We'd like to ensure that the sphinx node itself rejects all replayed
380382 // packets which share the same shared secret.
381- nodes , _ , _ , fwdMsg , err := newTestRoute (NumMaxHops )
383+ nodes , _ , _ , fwdMsg , err := newTestRoute (testLegacyRouteNumHops )
382384 if err != nil {
383385 t .Fatalf ("unable to create test route: %v" , err )
384386 }
@@ -423,7 +425,7 @@ func TestSphinxNodeRelpayLaterBatch(t *testing.T) {
423425func TestSphinxNodeReplayBatchIdempotency (t * testing.T ) {
424426 // We'd like to ensure that the sphinx node itself rejects all replayed
425427 // packets which share the same shared secret.
426- nodes , _ , _ , fwdMsg , err := newTestRoute (NumMaxHops )
428+ nodes , _ , _ , fwdMsg , err := newTestRoute (testLegacyRouteNumHops )
427429 if err != nil {
428430 t .Fatalf ("unable to create test route: %v" , err )
429431 }
0 commit comments