From 4800a841221d79ce8f9d399b19d843f572cf7954 Mon Sep 17 00:00:00 2001 From: bitromortac Date: Mon, 30 Mar 2020 10:45:38 +0200 Subject: [PATCH] channeldb: export sequenceNum in MPPayment Exports sequenceNum in MPPayment for later use in the rpcserver. --- channeldb/duplicate_payments.go | 2 +- channeldb/mp_payment.go | 4 ++-- channeldb/payments.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/channeldb/duplicate_payments.go b/channeldb/duplicate_payments.go index d5cbd1c2a..c78e2804b 100644 --- a/channeldb/duplicate_payments.go +++ b/channeldb/duplicate_payments.go @@ -162,7 +162,7 @@ func fetchDuplicatePayment(bucket kvdb.ReadBucket) (*MPPayment, error) { } payment := &MPPayment{ - sequenceNum: sequenceNum, + SequenceNum: sequenceNum, Info: creationInfo, FailureReason: failureReason, Status: paymentStatus, diff --git a/channeldb/mp_payment.go b/channeldb/mp_payment.go index e359ff03d..fd89f3ab4 100644 --- a/channeldb/mp_payment.go +++ b/channeldb/mp_payment.go @@ -108,9 +108,9 @@ type HTLCFailInfo struct { // have the associated Settle or Fail struct populated if the HTLC is no longer // in-flight. 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. - sequenceNum uint64 + SequenceNum uint64 // Info holds all static information about this payment, and is // populated when the payment is initiated. diff --git a/channeldb/payments.go b/channeldb/payments.go index 6c5730435..c355a06b9 100644 --- a/channeldb/payments.go +++ b/channeldb/payments.go @@ -246,7 +246,7 @@ func (db *DB) FetchPayments() ([]*MPPayment, error) { // Before returning, sort the payments by their sequence number. 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 @@ -334,7 +334,7 @@ func fetchPayment(bucket kvdb.ReadBucket) (*MPPayment, error) { } return &MPPayment{ - sequenceNum: sequenceNum, + SequenceNum: sequenceNum, Info: creationInfo, HTLCs: htlcs, FailureReason: failureReason,