add hop level bypass

This commit is contained in:
ginuerzh
2022-08-24 23:13:47 +08:00
parent bdd239fb09
commit 498a425656
3 changed files with 15 additions and 3 deletions

View File

@ -154,6 +154,18 @@ func ParseChain(cfg *config.ChainConfig) (chain.Chainer, error) {
sel = s
}
group.WithSelector(sel)
var bypasses []bypass.Bypass
if bp := registry.BypassRegistry().Get(hop.Bypass); bp != nil {
bypasses = append(bypasses, bp)
}
for _, s := range hop.Bypasses {
if bp := registry.BypassRegistry().Get(s); bp != nil {
bypasses = append(bypasses, bp)
}
}
group.WithBypass(bypass.BypassList(bypasses...))
c.AddNodeGroup(group)
}