routing: remove unused pruneVertexFailure parameters

This commit is contained in:
Joost Jager 2018-10-24 10:35:34 +02:00
parent dd7e2e9e04
commit aca136a91c
No known key found for this signature in database
GPG Key ID: AE6B0D042C8E38D9

@ -1807,7 +1807,7 @@ func (r *ChannelRouter) sendPayment(payment *LightningPayment,
r.applyChannelUpdate(&update, errSource) r.applyChannelUpdate(&update, errSource)
pruneVertexFailure( pruneVertexFailure(
paySession, route, errSource, false, paySession, errSource,
) )
continue continue
@ -1850,7 +1850,7 @@ func (r *ChannelRouter) sendPayment(payment *LightningPayment,
_, ok := errFailedFeeChans[chanID] _, ok := errFailedFeeChans[chanID]
if ok { if ok {
pruneVertexFailure( pruneVertexFailure(
paySession, route, errSource, false, paySession, errSource,
) )
continue continue
} }
@ -1869,7 +1869,7 @@ func (r *ChannelRouter) sendPayment(payment *LightningPayment,
r.applyChannelUpdate(&update, errSource) r.applyChannelUpdate(&update, errSource)
pruneVertexFailure( pruneVertexFailure(
paySession, route, errSource, false, paySession, errSource,
) )
continue continue
@ -1898,7 +1898,7 @@ func (r *ChannelRouter) sendPayment(payment *LightningPayment,
// continue. // continue.
case *lnwire.FailRequiredNodeFeatureMissing: case *lnwire.FailRequiredNodeFeatureMissing:
pruneVertexFailure( pruneVertexFailure(
paySession, route, errSource, false, paySession, errSource,
) )
continue continue
@ -1907,7 +1907,7 @@ func (r *ChannelRouter) sendPayment(payment *LightningPayment,
// continue. // continue.
case *lnwire.FailRequiredChannelFeatureMissing: case *lnwire.FailRequiredChannelFeatureMissing:
pruneVertexFailure( pruneVertexFailure(
paySession, route, errSource, false, paySession, errSource,
) )
continue continue
@ -1927,13 +1927,13 @@ func (r *ChannelRouter) sendPayment(payment *LightningPayment,
// routes. // routes.
case *lnwire.FailTemporaryNodeFailure: case *lnwire.FailTemporaryNodeFailure:
pruneVertexFailure( pruneVertexFailure(
paySession, route, errSource, false, paySession, errSource,
) )
continue continue
case *lnwire.FailPermanentNodeFailure: case *lnwire.FailPermanentNodeFailure:
pruneVertexFailure( pruneVertexFailure(
paySession, route, errSource, false, paySession, errSource,
) )
continue continue
@ -1948,7 +1948,7 @@ func (r *ChannelRouter) sendPayment(payment *LightningPayment,
// that node. // that node.
case *lnwire.FailExpiryTooFar: case *lnwire.FailExpiryTooFar:
pruneVertexFailure( pruneVertexFailure(
paySession, route, errSource, false, paySession, errSource,
) )
continue continue
@ -1971,24 +1971,11 @@ func (r *ChannelRouter) sendPayment(payment *LightningPayment,
// pruneVertexFailure will attempt to prune a vertex from the current available // pruneVertexFailure will attempt to prune a vertex from the current available
// vertexes of the target payment session in response to an encountered routing // vertexes of the target payment session in response to an encountered routing
// error. // error.
func pruneVertexFailure(paySession *paymentSession, route *Route, func pruneVertexFailure(paySession *paymentSession, errSource *btcec.PublicKey) {
errSource *btcec.PublicKey, nextNode bool) {
// By default, we'll try to prune the node that actually sent us the // By default, we'll try to prune the node that actually sent us the
// error. // error.
errNode := NewVertex(errSource) errNode := NewVertex(errSource)
// If this failure indicates that the node _after_ the source of the
// error was not found. As a result, we'll locate the vertex for that
// node itself.
if nextNode {
nodeToPrune, ok := route.nextHopVertex(errSource)
if ok {
errNode = nodeToPrune
}
}
// Once we've located the vertex, we'll report this failure to // Once we've located the vertex, we'll report this failure to
// missionControl and restart path finding. // missionControl and restart path finding.
paySession.ReportVertexFailure(errNode) paySession.ReportVertexFailure(errNode)