mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2025-12-18 22:54:26 +01:00
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:
@@ -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,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user