@@ -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,17 @@ func RpcToParameters(req *clientrpc.LiquidityParameters) (*Parameters,
481485 time .Second
482486 }
483487
488+ // Map excluded peers for easy autoloop, if any.
489+ for _ , p := range req .GetEasyAutoloopExcludedPeers () {
490+ v , err := route .NewVertexFromBytes (p )
491+ if err != nil {
492+ return nil , err
493+ }
494+ params .EasyAutoloopExcludedPeers = append (
495+ params .EasyAutoloopExcludedPeers , v ,
496+ )
497+ }
498+
484499 // If an old-style budget was written to storage then express it by
485500 // using the new auto budget parameters. If the newly added parameters
486501 // have the 0 default value, but a budget was defined that means the
@@ -603,6 +618,13 @@ func ParametersToRpc(cfg Parameters) (*clientrpc.LiquidityParameters,
603618 EasyAssetParams : easyAssetMap ,
604619 FastSwapPublication : cfg .FastSwapPublication ,
605620 }
621+ // Set excluded peers for easy autoloop.
622+ for _ , v := range cfg .EasyAutoloopExcludedPeers {
623+ b := v [:]
624+ rpcCfg .EasyAutoloopExcludedPeers = append (
625+ rpcCfg .EasyAutoloopExcludedPeers , b ,
626+ )
627+ }
606628
607629 switch f := cfg .FeeLimit .(type ) {
608630 case * FeeCategoryLimit :
0 commit comments