INNER CODE UNIT · Go

BenchmarkPathPacketConstruction

lightningnetwork/lightning-onion · bench_test.go:15

func BenchmarkPathPacketConstruction(b *testing.B) {
	b.StopTimer()

	var (
		err          error
		sphinxPacket *OnionPacket
		route        PaymentPath
	)

	for i := 0; i < 20; i++ {
		privKey, err := btcec.NewPrivateKey()
		if err != nil {
			b.Fatalf("unable to generate key: %v", privKey)
		}

		hopData := HopData{
			ForwardAmount: uint64(i),
			OutgoingCltv:  uint32(i),

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…