Skip to content

Commit 750770e

Browse files
authored
Merge pull request #8981 from ProofOfKeags/refactor/payment-descriptor-quarantine
[KILO]: Quarantine paymentDescriptor to the lnwallet package
2 parents 4fc2f4a + 93d17a4 commit 750770e

File tree

14 files changed

+552
-718
lines changed

14 files changed

+552
-718
lines changed

channeldb/forwarding_package.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,27 @@ func NewFwdPkg(source lnwire.ShortChannelID, height uint64,
286286
}
287287
}
288288

289+
// SourceRef is a convenience method that returns an AddRef to this forwarding
290+
// package for the index in the argument. It is the caller's responsibility
291+
// to ensure that the index is in bounds.
292+
func (f *FwdPkg) SourceRef(i uint16) AddRef {
293+
return AddRef{
294+
Height: f.Height,
295+
Index: i,
296+
}
297+
}
298+
299+
// DestRef is a convenience method that returns a SettleFailRef to this
300+
// forwarding package for the index in the argument. It is the caller's
301+
// responsibility to ensure that the index is in bounds.
302+
func (f *FwdPkg) DestRef(i uint16) SettleFailRef {
303+
return SettleFailRef{
304+
Source: f.Source,
305+
Height: f.Height,
306+
Index: i,
307+
}
308+
}
309+
289310
// ID returns an unique identifier for this package, used to ensure that sphinx
290311
// replay processing of this batch is idempotent.
291312
func (f *FwdPkg) ID() []byte {

0 commit comments

Comments
 (0)