routing: payment splitting pre-check

This commit reverts cb4cd49dc8 to bring
back the insufficient local balance failure.

Distinguishing betweeen this failure and a regular "no route" failure
prevents meaningless htlcs from being sent out.
This commit is contained in:
Joost Jager
2020-04-16 10:45:00 +02:00
parent f44a9e1d4c
commit 7fc1938f10
5 changed files with 63 additions and 18 deletions

View File

@@ -1768,7 +1768,7 @@ func TestPathInsufficientCapacity(t *testing.T) {
noRestrictions, testPathFindingConfig,
sourceNode.PubKeyBytes, target, payAmt, 0,
)
if err != errNoPathFound {
if err != errInsufficientBalance {
t.Fatalf("graph shouldn't be able to support payment: %v", err)
}
}
@@ -2790,6 +2790,7 @@ type pathFindingTestContext struct {
t *testing.T
graph *channeldb.ChannelGraph
restrictParams RestrictParams
bandwidthHints map[uint64]lnwire.MilliSatoshi
pathFindingConfig PathFindingConfig
testGraphInstance *testGraphInstance
source route.Vertex
@@ -2844,8 +2845,8 @@ func (c *pathFindingTestContext) findPath(target route.Vertex,
error) {
return dbFindPath(
c.graph, nil, nil, &c.restrictParams, &c.pathFindingConfig,
c.source, target, amt, 0,
c.graph, nil, c.bandwidthHints, &c.restrictParams,
&c.pathFindingConfig, c.source, target, amt, 0,
)
}