@@ -116,6 +116,10 @@ type Parameters struct {
116116 // maintain in our channels.
117117 EasyAutoloopTarget btcutil.Amount
118118
119+ // EasyAutoloopExcludedPeers is an optional list of peers that should be
120+ // excluded from being selected for easy autoloop swaps.
121+ EasyAutoloopExcludedPeers []route.Vertex
122+
119123 // AssetAutoloopParams maps an asset id hex encoded string to its
120124 // easy autoloop parameters.
121125 AssetAutoloopParams map [string ]AssetParams
@@ -481,6 +485,21 @@ func RpcToParameters(req *clientrpc.LiquidityParameters) (*Parameters,
481485 time .Second
482486 }
483487
488+ // Map excluded peers for easy autoloop, if any.
489+ excludedPeersRPC := req .GetEasyAutoloopExcludedPeers ()
490+ params .EasyAutoloopExcludedPeers = make (
491+ []route.Vertex , 0 , len (excludedPeersRPC ),
492+ )
493+ for _ , p := range excludedPeersRPC {
494+ v , err := route .NewVertexFromBytes (p )
495+ if err != nil {
496+ return nil , err
497+ }
498+ params .EasyAutoloopExcludedPeers = append (
499+ params .EasyAutoloopExcludedPeers , v ,
500+ )
501+ }
502+
484503 // If an old-style budget was written to storage then express it by
485504 // using the new auto budget parameters. If the newly added parameters
486505 // have the 0 default value, but a budget was defined that means the
@@ -603,6 +622,15 @@ func ParametersToRpc(cfg Parameters) (*clientrpc.LiquidityParameters,
603622 EasyAssetParams : easyAssetMap ,
604623 FastSwapPublication : cfg .FastSwapPublication ,
605624 }
625+ // Set excluded peers for easy autoloop.
626+ rpcCfg .EasyAutoloopExcludedPeers = make (
627+ [][]byte , 0 , len (cfg .EasyAutoloopExcludedPeers ),
628+ )
629+ for _ , v := range cfg .EasyAutoloopExcludedPeers {
630+ rpcCfg .EasyAutoloopExcludedPeers = append (
631+ rpcCfg .EasyAutoloopExcludedPeers , v [:],
632+ )
633+ }
606634
607635 switch f := cfg .FeeLimit .(type ) {
608636 case * FeeCategoryLimit :
0 commit comments