channeldb+router: record payment failure reason in db

This commit is contained in:
Johan T. Halseth committed 2019-05-27 20:18:59 +02:00
1 parent 60e2367973
commit 1b788904f0
5 files changed
+106 -23

No files matched your search

+4 -2
View File
@@ -167,6 +167,7 @@ type successArgs struct {
}
type failArgs struct {
reason channeldb.FailureReason
}
type mockControlTower struct {
@@ -253,13 +254,14 @@ func (m *mockControlTower) Success(phash lntypes.Hash,
return nil
}
func (m *mockControlTower) Fail(phash lntypes.Hash) error {
func (m *mockControlTower) Fail(phash lntypes.Hash,
reason channeldb.FailureReason) error {
m.Lock()
defer m.Unlock()
if m.fail != nil {
m.fail <- failArgs{}
m.fail <- failArgs{reason}
}
delete(m.inflights, phash)