mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 09:48:19 +01:00
Merge pull request #5598 from champo/relax_channel_disabled
routing: relax penalties for channel disabled errors
This commit is contained in:
commit
11b157705c
3 changed files with 42 additions and 2 deletions
|
@ -479,6 +479,12 @@ messages directly. There is no routing/path finding involved.
|
||||||
* [Save compressed log files from logrorate during
|
* [Save compressed log files from logrorate during
|
||||||
itest](https://github.com/lightningnetwork/lnd/pull/5354).
|
itest](https://github.com/lightningnetwork/lnd/pull/5354).
|
||||||
|
|
||||||
|
## Mission control
|
||||||
|
|
||||||
|
* [Interpretation of channel disabled errors was changed to only penalize t
|
||||||
|
he destination node to consider mobile wallets with hub
|
||||||
|
nodes.](https://github.com/lightningnetwork/lnd/pull/5598)
|
||||||
|
|
||||||
## Bug Fixes
|
## Bug Fixes
|
||||||
|
|
||||||
* A bug has been fixed that would cause `lnd` to [try to bootstrap using the
|
* A bug has been fixed that would cause `lnd` to [try to bootstrap using the
|
||||||
|
|
|
@ -335,6 +335,23 @@ func (i *interpretedResult) processPaymentOutcomeIntermediate(
|
||||||
case *lnwire.FailUnknownNextPeer:
|
case *lnwire.FailUnknownNextPeer:
|
||||||
reportOutgoing()
|
reportOutgoing()
|
||||||
|
|
||||||
|
// Some implementations use this error when the next hop is offline, so we
|
||||||
|
// do the same as FailUnknownNextPeer and also process the channel update.
|
||||||
|
case *lnwire.FailChannelDisabled:
|
||||||
|
|
||||||
|
// Set the node pair for which a channel update may be out of
|
||||||
|
// date. The second chance logic uses the policyFailure field.
|
||||||
|
i.policyFailure = &DirectedNodePair{
|
||||||
|
From: route.Hops[errorSourceIdx-1].PubKeyBytes,
|
||||||
|
To: route.Hops[errorSourceIdx].PubKeyBytes,
|
||||||
|
}
|
||||||
|
|
||||||
|
reportOutgoing()
|
||||||
|
|
||||||
|
// All nodes up to the failing pair must have forwarded
|
||||||
|
// successfully.
|
||||||
|
i.successPairRange(route, 0, errorSourceIdx-1)
|
||||||
|
|
||||||
// If we get a permanent channel, we'll prune the channel set in both
|
// If we get a permanent channel, we'll prune the channel set in both
|
||||||
// directions and continue with the rest of the routes.
|
// directions and continue with the rest of the routes.
|
||||||
case *lnwire.FailPermanentChannelFailure:
|
case *lnwire.FailPermanentChannelFailure:
|
||||||
|
@ -349,8 +366,7 @@ func (i *interpretedResult) processPaymentOutcomeIntermediate(
|
||||||
// control.
|
// control.
|
||||||
case *lnwire.FailAmountBelowMinimum,
|
case *lnwire.FailAmountBelowMinimum,
|
||||||
*lnwire.FailFeeInsufficient,
|
*lnwire.FailFeeInsufficient,
|
||||||
*lnwire.FailIncorrectCltvExpiry,
|
*lnwire.FailIncorrectCltvExpiry:
|
||||||
*lnwire.FailChannelDisabled:
|
|
||||||
|
|
||||||
// Set the node pair for which a channel update may be out of
|
// Set the node pair for which a channel update may be out of
|
||||||
// date. The second chance logic uses the policyFailure field.
|
// date. The second chance logic uses the policyFailure field.
|
||||||
|
|
|
@ -349,6 +349,24 @@ var resultTestCases = []resultTestCase{
|
||||||
nodeFailure: nil,
|
nodeFailure: nil,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Test a channel disabled failure from the final hop in two hops. Only the
|
||||||
|
// disabled channel should be penalized for any amount.
|
||||||
|
{
|
||||||
|
name: "two hop channel disabled",
|
||||||
|
route: &routeTwoHop,
|
||||||
|
failureSrcIdx: 1,
|
||||||
|
failure: &lnwire.FailChannelDisabled{},
|
||||||
|
|
||||||
|
expectedResult: &interpretedResult{
|
||||||
|
pairResults: map[DirectedNodePair]pairResult{
|
||||||
|
getTestPair(1, 2): failPairResult(0),
|
||||||
|
getTestPair(2, 1): failPairResult(0),
|
||||||
|
getTestPair(0, 1): successPairResult(100),
|
||||||
|
},
|
||||||
|
policyFailure: getPolicyFailure(1, 2),
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// TestResultInterpretation executes a list of test cases that test the result
|
// TestResultInterpretation executes a list of test cases that test the result
|
||||||
|
|
Loading…
Add table
Reference in a new issue