Skip to content

Commit

Permalink
Tweak mission control when the destination uses a private channel
Browse files Browse the repository at this point in the history
  • Loading branch information
yaslama committed Aug 10, 2021
1 parent 9ab0c14 commit 672d1da
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
11 changes: 11 additions & 0 deletions account/payments.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,17 @@ func (a *Service) sendPayment(paymentHash string, payReq *lnrpc.PayReq, sendRequ
return "", err
}

if payReq != nil && len(payReq.RouteHints) == 1 && len(payReq.RouteHints[0].HopHints) == 1 {
lnclient.XImportMissionControl(context.Background(), &routerrpc.XImportMissionControlRequest{
Pairs: []*routerrpc.PairHistory{{
NodeFrom: []byte(payReq.RouteHints[0].HopHints[0].NodeId),
NodeTo: []byte(payReq.Destination),
History: &routerrpc.PairData{
SuccessTime: time.Now().UnixNano(),
SuccessAmtMsat: payReq.NumMsat,
},
}}})
}
a.log.Infof("sending payment with max fee = %v msat", sendRequest.FeeLimitMsat)
response, err := lnclient.SendPaymentV2(context.Background(), sendRequest)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ replace (
github.com/btcsuite/btcwallet/walletdb => github.com/breez/btcwallet/walletdb v1.3.5-0.20210414123232-efee8e15b2ad
github.com/btcsuite/btcwallet/wtxmgr => github.com/breez/btcwallet/wtxmgr v1.2.1-0.20210414123232-efee8e15b2ad
github.com/lightninglabs/neutrino => github.com/breez/neutrino v0.11.1-0.20210510081759-0f2f35bed719
github.com/lightningnetwork/lnd => github.com/breez/lnd v0.12.1-beta.rc6.0.20210622110244-3dc30928c3a2
github.com/lightningnetwork/lnd => github.com/breez/lnd v0.12.1-beta.rc6.0.20210719131344-b444ae37125d
github.com/lightningnetwork/lnd/cert => github.com/breez/lnd/cert v1.0.4-0.20210531094737-c875a5650e2b
)

Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ github.com/breez/lnd v0.12.1-beta.rc6.0.20210531094737-c875a5650e2b h1:x3cjenF1b
github.com/breez/lnd v0.12.1-beta.rc6.0.20210531094737-c875a5650e2b/go.mod h1:2GyP1IG1kXV5Af/LOCxnXfux1OP3fAGr8zptS5PB2YI=
github.com/breez/lnd v0.12.1-beta.rc6.0.20210622110244-3dc30928c3a2 h1:sFycuqBmstyjWaifXtyN/txMRDL6z/ogL71g/nsksuI=
github.com/breez/lnd v0.12.1-beta.rc6.0.20210622110244-3dc30928c3a2/go.mod h1:2GyP1IG1kXV5Af/LOCxnXfux1OP3fAGr8zptS5PB2YI=
github.com/breez/lnd v0.12.1-beta.rc6.0.20210719131344-b444ae37125d h1:GZ1GEkE9L/DbWM7vhjEsByO7IZqE2PeTzj/LZDJJOIA=
github.com/breez/lnd v0.12.1-beta.rc6.0.20210719131344-b444ae37125d/go.mod h1:2GyP1IG1kXV5Af/LOCxnXfux1OP3fAGr8zptS5PB2YI=
github.com/breez/lnd/cert v1.0.4-0.20210418142716-88eb7459a966 h1:X91JwQ2LGJDQxZkSMYjelnsmMr+0rBTa0I2Nq5IDvWU=
github.com/breez/lnd/cert v1.0.4-0.20210418142716-88eb7459a966/go.mod h1:3MWXVLLPI0Mg0XETm9fT4N9Vyy/8qQLmaM5589bEggM=
github.com/breez/lnd/cert v1.0.4-0.20210418144450-b6bc19f0c4dd h1:oY27JwFZiaWiSP+m6VV71XK4F6mkQHXltLX4QGSV+AA=
Expand Down

0 comments on commit 672d1da

Please sign in to comment.