mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-10 01:03:03 +02:00
channeldb: export sequenceNum in MPPayment
Exports sequenceNum in MPPayment for later use in the rpcserver.
This commit is contained in:
@@ -162,7 +162,7 @@ func fetchDuplicatePayment(bucket kvdb.ReadBucket) (*MPPayment, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
payment := &MPPayment{
|
payment := &MPPayment{
|
||||||
sequenceNum: sequenceNum,
|
SequenceNum: sequenceNum,
|
||||||
Info: creationInfo,
|
Info: creationInfo,
|
||||||
FailureReason: failureReason,
|
FailureReason: failureReason,
|
||||||
Status: paymentStatus,
|
Status: paymentStatus,
|
||||||
|
@@ -108,9 +108,9 @@ type HTLCFailInfo struct {
|
|||||||
// have the associated Settle or Fail struct populated if the HTLC is no longer
|
// have the associated Settle or Fail struct populated if the HTLC is no longer
|
||||||
// in-flight.
|
// in-flight.
|
||||||
type MPPayment struct {
|
type MPPayment struct {
|
||||||
// sequenceNum is a unique identifier used to sort the payments in
|
// SequenceNum is a unique identifier used to sort the payments in
|
||||||
// order of creation.
|
// order of creation.
|
||||||
sequenceNum uint64
|
SequenceNum uint64
|
||||||
|
|
||||||
// Info holds all static information about this payment, and is
|
// Info holds all static information about this payment, and is
|
||||||
// populated when the payment is initiated.
|
// populated when the payment is initiated.
|
||||||
|
@@ -246,7 +246,7 @@ func (db *DB) FetchPayments() ([]*MPPayment, error) {
|
|||||||
|
|
||||||
// Before returning, sort the payments by their sequence number.
|
// Before returning, sort the payments by their sequence number.
|
||||||
sort.Slice(payments, func(i, j int) bool {
|
sort.Slice(payments, func(i, j int) bool {
|
||||||
return payments[i].sequenceNum < payments[j].sequenceNum
|
return payments[i].SequenceNum < payments[j].SequenceNum
|
||||||
})
|
})
|
||||||
|
|
||||||
return payments, nil
|
return payments, nil
|
||||||
@@ -334,7 +334,7 @@ func fetchPayment(bucket kvdb.ReadBucket) (*MPPayment, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return &MPPayment{
|
return &MPPayment{
|
||||||
sequenceNum: sequenceNum,
|
SequenceNum: sequenceNum,
|
||||||
Info: creationInfo,
|
Info: creationInfo,
|
||||||
HTLCs: htlcs,
|
HTLCs: htlcs,
|
||||||
FailureReason: failureReason,
|
FailureReason: failureReason,
|
||||||
|
Reference in New Issue
Block a user