mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-01 10:11:11 +02:00
channeldb: Serialize/deserialize AMP struct in hop
The AMP struct in a hop was never being set when deserizlied. Also, the AMP TLV record was not being added when the hop was serialized. This sets the TLV record when serializing and correctly sets the AMP struct on the hop when that record is present. Co-authored-by: BitcoinCoderBob <90647227+BitcoinCoderBob@users.noreply.github.com> Co-authored-by: Tee8z <tee8z@protonmail.com>
This commit is contained in:
@@ -44,11 +44,25 @@ var (
|
||||
LegacyPayload: true,
|
||||
}
|
||||
|
||||
testHop3 = &route.Hop{
|
||||
PubKeyBytes: route.NewVertex(pub),
|
||||
ChannelID: 12345,
|
||||
OutgoingTimeLock: 111,
|
||||
AmtToForward: 555,
|
||||
CustomRecords: record.CustomSet{
|
||||
65536: []byte{},
|
||||
80001: []byte{},
|
||||
},
|
||||
AMP: record.NewAMP([32]byte{0x69}, [32]byte{0x42}, 1),
|
||||
Metadata: []byte{1, 2, 3},
|
||||
}
|
||||
|
||||
testRoute = route.Route{
|
||||
TotalTimeLock: 123,
|
||||
TotalAmount: 1234567,
|
||||
SourcePubKey: vertex,
|
||||
Hops: []*route.Hop{
|
||||
testHop3,
|
||||
testHop2,
|
||||
testHop1,
|
||||
},
|
||||
|
Reference in New Issue
Block a user