mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-28 14:40:51 +02:00
channeldb+routing: add new interface method TerminalInfo
This commit adds a new interface method `TerminalInfo` and changes its implementation to return an `*HTLCAttempt` so it includes the route for a successful payment. Method `GetFailureReason` is now removed as its returned value can be found in the above method.
This commit is contained in:
@@ -828,22 +828,34 @@ func (m *mockMPPayment) InFlightHTLCs() []channeldb.HTLCAttempt {
|
||||
return args.Get(0).([]channeldb.HTLCAttempt)
|
||||
}
|
||||
|
||||
func (m *mockMPPayment) GetFailureReason() *channeldb.FailureReason {
|
||||
args := m.Called()
|
||||
|
||||
reason := args.Get(0)
|
||||
if reason == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return reason.(*channeldb.FailureReason)
|
||||
}
|
||||
|
||||
func (m *mockMPPayment) AllowMoreAttempts() (bool, error) {
|
||||
args := m.Called()
|
||||
return args.Bool(0), args.Error(1)
|
||||
}
|
||||
|
||||
func (m *mockMPPayment) TerminalInfo() (*channeldb.HTLCAttempt,
|
||||
*channeldb.FailureReason) {
|
||||
|
||||
args := m.Called()
|
||||
|
||||
var (
|
||||
settleInfo *channeldb.HTLCAttempt
|
||||
failureInfo *channeldb.FailureReason
|
||||
)
|
||||
|
||||
settle := args.Get(0)
|
||||
if settle != nil {
|
||||
settleInfo = settle.(*channeldb.HTLCAttempt)
|
||||
}
|
||||
|
||||
reason := args.Get(1)
|
||||
if reason != nil {
|
||||
failureInfo = reason.(*channeldb.FailureReason)
|
||||
}
|
||||
|
||||
return settleInfo, failureInfo
|
||||
}
|
||||
|
||||
type mockLink struct {
|
||||
htlcswitch.ChannelLink
|
||||
bandwidth lnwire.MilliSatoshi
|
||||
|
Reference in New Issue
Block a user