Skip to content

Commit 7547c23

Browse files
routing: export dbMPPayment interface
This will assist external programs attempting to re-use ChannelRouter code and leverage the ControlTower's FetchPayment method.
1 parent 1bf7ad9 commit 7547c23

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

routing/control_tower.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import (
99
"github.com/lightningnetwork/lnd/queue"
1010
)
1111

12-
// dbMPPayment is an interface derived from channeldb.MPPayment that is used by
12+
// DBMPPayment is an interface derived from channeldb.MPPayment that is used by
1313
// the payment lifecycle.
14-
type dbMPPayment interface {
14+
type DBMPPayment interface {
1515
// GetState returns the current state of the payment.
1616
GetState() *channeldb.MPPaymentState
1717

@@ -76,7 +76,7 @@ type ControlTower interface {
7676

7777
// FetchPayment fetches the payment corresponding to the given payment
7878
// hash.
79-
FetchPayment(paymentHash lntypes.Hash) (dbMPPayment, error)
79+
FetchPayment(paymentHash lntypes.Hash) (DBMPPayment, error)
8080

8181
// FailPayment transitions a payment into the Failed state, and records
8282
// the ultimate reason the payment failed. Note that this should only
@@ -273,7 +273,7 @@ func (p *controlTower) FailAttempt(paymentHash lntypes.Hash,
273273

274274
// FetchPayment fetches the payment corresponding to the given payment hash.
275275
func (p *controlTower) FetchPayment(paymentHash lntypes.Hash) (
276-
dbMPPayment, error) {
276+
DBMPPayment, error) {
277277

278278
return p.db.FetchPayment(paymentHash)
279279
}

routing/mock_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ func (m *mockControlTowerOld) FailPayment(phash lntypes.Hash,
504504
}
505505

506506
func (m *mockControlTowerOld) FetchPayment(phash lntypes.Hash) (
507-
dbMPPayment, error) {
507+
DBMPPayment, error) {
508508

509509
m.Lock()
510510
defer m.Unlock()
@@ -776,7 +776,7 @@ func (m *mockControlTower) FailPayment(phash lntypes.Hash,
776776
}
777777

778778
func (m *mockControlTower) FetchPayment(phash lntypes.Hash) (
779-
dbMPPayment, error) {
779+
DBMPPayment, error) {
780780

781781
args := m.Called(phash)
782782

@@ -814,7 +814,7 @@ type mockMPPayment struct {
814814
mock.Mock
815815
}
816816

817-
var _ dbMPPayment = (*mockMPPayment)(nil)
817+
var _ DBMPPayment = (*mockMPPayment)(nil)
818818

819819
func (m *mockMPPayment) GetState() *channeldb.MPPaymentState {
820820
args := m.Called()

routing/payment_lifecycle.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const (
109109

110110
// decideNextStep is used to determine the next step in the payment lifecycle.
111111
func (p *paymentLifecycle) decideNextStep(
112-
payment dbMPPayment) (stateStep, error) {
112+
payment DBMPPayment) (stateStep, error) {
113113

114114
// Check whether we could make new HTLC attempts.
115115
allow, err := payment.AllowMoreAttempts()

0 commit comments

Comments
 (0)