mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-10 21:22:37 +02:00
routerrpc: convert sendpayment to async
Modify the routerrpc SendPayment api to asynchronous. This allows callers to pick up a payment after the rpc connection was lost or lnd was restarted.
This commit is contained in:
@@ -192,6 +192,8 @@ type server struct {
|
||||
|
||||
chanRouter *routing.ChannelRouter
|
||||
|
||||
controlTower routing.ControlTower
|
||||
|
||||
authGossiper *discovery.AuthenticatedGossiper
|
||||
|
||||
utxoNursery *utxoNursery
|
||||
@@ -651,12 +653,14 @@ func newServer(listenAddrs []net.Addr, chanDB *channeldb.DB, cc *chainControl,
|
||||
|
||||
paymentControl := channeldb.NewPaymentControl(chanDB)
|
||||
|
||||
s.controlTower = routing.NewControlTower(paymentControl)
|
||||
|
||||
s.chanRouter, err = routing.New(routing.Config{
|
||||
Graph: chanGraph,
|
||||
Chain: cc.chainIO,
|
||||
ChainView: cc.chainView,
|
||||
Payer: s.htlcSwitch,
|
||||
Control: routing.NewControlTower(paymentControl),
|
||||
Control: s.controlTower,
|
||||
MissionControl: s.missionControl,
|
||||
ChannelPruneExpiry: routing.DefaultChannelPruneExpiry,
|
||||
GraphPruneInterval: time.Duration(time.Hour),
|
||||
|
Reference in New Issue
Block a user