htlcswitch/test: test canceled invoice

This commit is contained in:
Joost Jager committed 2019-02-06 07:29:35 +01:00
1 parent f80fb286d8
commit 077852cd4e
2 files changed
+68

No files matched your search

+11
View File
@@ -670,6 +670,17 @@ func waitForPaymentResult(c chan error, d time.Duration) error {
}
}
// waitForPayFuncResult executes the given function and waits for a result with
// a timeout.
func waitForPayFuncResult(payFunc func() error, d time.Duration) error {
errChan := make(chan error)
go func() {
errChan <- payFunc()
}()
return waitForPaymentResult(errChan, d)
}
// makePayment takes the destination node and amount as input, sends the
// payment and returns the error channel to wait for error to be received and
// invoice in order to check its status after the payment finished.