routing: add AllowMoreAttempts to decide whether more attempts are allowed

This commit is contained in:
yyforyongyu committed 2023-11-13 16:09:11 +08:00
1 parent 9a0db291b5
commit e8c0226e1c
4 files changed
+232

No files matched your search

+5
View File
@@ -33,6 +33,11 @@ type dbMPPayment interface {
// GetFailureReason returns the reason the payment failed.
GetFailureReason() *channeldb.FailureReason
// AllowMoreAttempts is used to decide whether we can safely attempt
// more HTLCs for a given payment state. Return an error if the payment
// is in an unexpected state.
AllowMoreAttempts() (bool, error)
}
// ControlTower tracks all outgoing payments made, whose primary purpose is to
+5
View File
@@ -839,6 +839,11 @@ func (m *mockMPPayment) GetFailureReason() *channeldb.FailureReason {
return reason.(*channeldb.FailureReason)
}
func (m *mockMPPayment) AllowMoreAttempts() (bool, error) {
args := m.Called()
return args.Bool(0), args.Error(1)
}
type mockLink struct {
htlcswitch.ChannelLink
bandwidth lnwire.MilliSatoshi