htlcswitch: check channel policy for local htlcs

This commit is contained in:
Joost Jager committed 2019-05-03 12:22:36 +02:00
1 parent e571532d9a
commit f5f6a52ed8
7 files changed
+162 -78

No files matched your search

+10 -1
View File
@@ -612,6 +612,8 @@ type mockChannelLink struct {
eligible bool
htlcID uint64
htlcSatifiesPolicyLocalResult lnwire.FailureMessage
}
// completeCircuit is a helper method for adding the finalized payment circuit
@@ -675,6 +677,13 @@ func (f *mockChannelLink) HtlcSatifiesPolicy([32]byte, lnwire.MilliSatoshi,
return nil
}
func (f *mockChannelLink) HtlcSatifiesPolicyLocal(payHash [32]byte,
amt lnwire.MilliSatoshi, timeout uint32,
heightNow uint32) lnwire.FailureMessage {
return f.htlcSatifiesPolicyLocalResult
}
func (f *mockChannelLink) Stats() (uint64, lnwire.MilliSatoshi, lnwire.MilliSatoshi) {
return 0, 0, 0
}
@@ -728,7 +737,7 @@ func newDB() (*channeldb.DB, func(), error) {
return cdb, cleanUp, nil
}
const testInvoiceCltvExpiry = 4
const testInvoiceCltvExpiry = 6
type mockInvoiceRegistry struct {
settleChan chan lntypes.Hash