mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-13 18:10:25 +02:00
routing/test: add test for stuck payment with in-flight htlcs
Add an additional stuck-payment case, where our payment gets a terminal error while it has other htlcs in-flight, and a shard fails with ErrTerminalPayment. This payment also falls in our class of expected errors, but is not currently handled. The mock is updated accordingly, using the same ordering as in our real RegisterAttempt implementation.
This commit is contained in:
@@ -333,6 +333,10 @@ func (m *mockControlTower) RegisterAttempt(phash lntypes.Hash,
|
||||
return channeldb.ErrPaymentAlreadyFailed
|
||||
}
|
||||
|
||||
if settled || failed {
|
||||
return channeldb.ErrPaymentTerminal
|
||||
}
|
||||
|
||||
// Add attempt to payment.
|
||||
p.attempts = append(p.attempts, channeldb.HTLCAttempt{
|
||||
HTLCAttemptInfo: *a,
|
||||
|
Reference in New Issue
Block a user