htlcswitch: Rename htlcPacket fields for clarity.

The src/dest terminology for routing packets is kind of confusing
because the source HTLC may not be the source of the packet for
settles/fails traversing the circuit in the opposite direction. This
changes the nomenclature to incoming/outgoing and always references
the HTLCs themselves.
This commit is contained in:
Jim Posen authored and Olaoluwa Osuntokun committed 2017-12-14 17:53:58 -08:00
1 parent 66e654bb42
commit 4a29fbdab2
6 files changed
+149 -145

No files matched your search

+4 -4
View File
@@ -30,10 +30,10 @@ func TestMailBoxCouriers(t *testing.T) {
sentPackets := make([]*htlcPacket, numPackets)
for i := 0; i < numPackets; i++ {
pkt := &htlcPacket{
dest: lnwire.NewShortChanIDFromInt(uint64(prand.Int63())),
src: lnwire.NewShortChanIDFromInt(uint64(prand.Int63())),
amount: lnwire.MilliSatoshi(prand.Int63()),
isObfuscated: i%2 == 0,
outgoingChanID: lnwire.NewShortChanIDFromInt(uint64(prand.Int63())),
incomingChanID: lnwire.NewShortChanIDFromInt(uint64(prand.Int63())),
amount: lnwire.MilliSatoshi(prand.Int63()),
isObfuscated: i%2 == 0,
}
sentPackets[i] = pkt