Skip to content

Commit

Permalink
Merge pull request #8981 from ProofOfKeags/refactor/payment-descripto…
Browse files Browse the repository at this point in the history
…r-quarantine

[KILO]: Quarantine paymentDescriptor to the lnwallet package
  • Loading branch information
guggero committed Sep 12, 2024
2 parents 4fc2f4a + 93d17a4 commit 750770e
Show file tree
Hide file tree
Showing 14 changed files with 552 additions and 718 deletions.
21 changes: 21 additions & 0 deletions channeldb/forwarding_package.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,27 @@ func NewFwdPkg(source lnwire.ShortChannelID, height uint64,
}
}

// SourceRef is a convenience method that returns an AddRef to this forwarding
// package for the index in the argument. It is the caller's responsibility
// to ensure that the index is in bounds.
func (f *FwdPkg) SourceRef(i uint16) AddRef {
return AddRef{
Height: f.Height,
Index: i,
}
}

// DestRef is a convenience method that returns a SettleFailRef to this
// forwarding package for the index in the argument. It is the caller's
// responsibility to ensure that the index is in bounds.
func (f *FwdPkg) DestRef(i uint16) SettleFailRef {
return SettleFailRef{
Source: f.Source,
Height: f.Height,
Index: i,
}
}

// ID returns an unique identifier for this package, used to ensure that sphinx
// replay processing of this batch is idempotent.
func (f *FwdPkg) ID() []byte {
Expand Down
Loading

0 comments on commit 750770e

Please sign in to comment.