mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-19 05:11:25 +02:00
lnwallet: reorder PaymentDescriptor attributes to reduce padding
This commit is contained in:
parent
9ff4a7adc9
commit
eca3a10064
@ -99,7 +99,7 @@ type updateType uint8
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
// Add is an update type that adds a new HTLC entry into the log.
|
// Add is an update type that adds a new HTLC entry into the log.
|
||||||
// Either side can add a new penidng HTLC by adding a new Add entry
|
// Either side can add a new pending HTLC by adding a new Add entry
|
||||||
// into their update log.
|
// into their update log.
|
||||||
Add updateType = iota
|
Add updateType = iota
|
||||||
|
|
||||||
@ -150,15 +150,6 @@ type PaymentDescriptor struct {
|
|||||||
// settles or times out.
|
// settles or times out.
|
||||||
ParentIndex uint64
|
ParentIndex uint64
|
||||||
|
|
||||||
// Payload is an opaque blob which is used to complete multi-hop
|
|
||||||
// routing.
|
|
||||||
Payload []byte
|
|
||||||
|
|
||||||
// EntryType denotes the exact type of the PaymentDescriptor. In the
|
|
||||||
// case of a Timeout, or Settle type, then the Parent field will point
|
|
||||||
// into the log to the HTLC being modified.
|
|
||||||
EntryType updateType
|
|
||||||
|
|
||||||
// addCommitHeight[Remote|Local] encodes the height of the commitment
|
// addCommitHeight[Remote|Local] encodes the height of the commitment
|
||||||
// which included this HTLC on either the remote or local commitment
|
// which included this HTLC on either the remote or local commitment
|
||||||
// chain. This value is used to determine when an HTLC is fully
|
// chain. This value is used to determine when an HTLC is fully
|
||||||
@ -174,24 +165,36 @@ type PaymentDescriptor struct {
|
|||||||
removeCommitHeightRemote uint64
|
removeCommitHeightRemote uint64
|
||||||
removeCommitHeightLocal uint64
|
removeCommitHeightLocal uint64
|
||||||
|
|
||||||
// isForwarded denotes if an incoming HTLC has been forwarded to any
|
// Payload is an opaque blob which is used to complete multi-hop
|
||||||
// possible upstream peers in the route.
|
// routing.
|
||||||
isForwarded bool
|
Payload []byte
|
||||||
|
|
||||||
// [our|their|theirPrev]PkScript are the raw public key scripts that
|
// [our|their|]PkScript are the raw public key scripts that encodes the
|
||||||
// encodes the redemption rules for this particular HTLC. These fields
|
// redemption rules for this particular HTLC. These fields will only be
|
||||||
// will only be populated iff the EntryType of this PaymentDescriptor
|
// populated iff the EntryType of this PaymentDescriptor is Add.
|
||||||
// is Add. ourPkScript is the ourPkScript from the context of our local
|
// ourPkScript is the ourPkScript from the context of our local
|
||||||
// commitment chain. [their|theirPrev]PkScript are the two latest
|
// commitment chain. theirPkScript is the latest pkScript from the
|
||||||
// pkScripts from the context of the remote commitment chain.
|
// context of the remote commitment chain.
|
||||||
ourPkScript []byte
|
//
|
||||||
theirPkScript []byte
|
// NOTE: These values may change within the logs themselves, however,
|
||||||
theirPrevPkScript []byte
|
// they'll stay consistent within the commitment chain entries
|
||||||
|
// themselves.
|
||||||
|
ourPkScript []byte
|
||||||
|
theirPkScript []byte
|
||||||
|
|
||||||
|
// EntryType denotes the exact type of the PaymentDescriptor. In the
|
||||||
|
// case of a Timeout, or Settle type, then the Parent field will point
|
||||||
|
// into the log to the HTLC being modified.
|
||||||
|
EntryType updateType
|
||||||
|
|
||||||
// isDust[Local|Remote] denotes if this HTLC is below the dust limit in
|
// isDust[Local|Remote] denotes if this HTLC is below the dust limit in
|
||||||
// locally or remotely.
|
// locally or remotely.
|
||||||
isDustLocal bool
|
isDustLocal bool
|
||||||
isDustRemote bool
|
isDustRemote bool
|
||||||
|
|
||||||
|
// isForwarded denotes if an incoming HTLC has been forwarded to any
|
||||||
|
// possible upstream peers in the route.
|
||||||
|
isForwarded bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// commitment represents a commitment to a new state within an active channel.
|
// commitment represents a commitment to a new state within an active channel.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user