mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-31 17:51:33 +02:00
invoices: add TestSpontaneousAmpPayment
Adds a set of test cases that exercise the spontaneous AMP payment flow with valid and invalid reconstructions, as well as with single and multiple HTLCs. This also asserts that spontaneous AMP is gated behind the existing AcceptKeysend flag.
This commit is contained in:
@@ -180,6 +180,23 @@ func (f FailResolutionResult) FailureString() string {
|
||||
}
|
||||
}
|
||||
|
||||
// IsSetFailure returns true if this failure should result in the entire HTLC
|
||||
// set being failed with the same result.
|
||||
func (f FailResolutionResult) IsSetFailure() bool {
|
||||
switch f {
|
||||
case
|
||||
ResultAmpReconstruction,
|
||||
ResultHtlcSetTotalTooLow,
|
||||
ResultHtlcSetTotalMismatch,
|
||||
ResultHtlcSetOverpayment:
|
||||
|
||||
return true
|
||||
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// SettleResolutionResult provides metadata which about a htlc that was failed
|
||||
// by the registry. It can be used to take custom actions on resolution of the
|
||||
// htlc.
|
||||
|
Reference in New Issue
Block a user