NTMinerNoDevFee: fix #131, restrict port to improve passthrough performance #143
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NTMinerNoDevFee原有的filter是
outbound && ip && ip.DstAddr != 127.0.0.1 && tcp && tcp.PayloadLength > 100
这样很大一部分出站的包都要经过NTMinerNoDevFee,拖慢了系统的性能。
这个改动把各内核命令行参数里的矿池地址和端口抓了出来,应用到WinDivert的filter上,使得大多数无关的包不会被WinDivert拦截。
这里我虽然抓了矿池的地址和端口,但filter只应用了端口,原因是地址有时会被DNS解析到不同的IP地址,所以filter要加地址的话还要DNS查询出所有的IP,麻烦一点。所以只是预留了但实际并没有用。此外,实际测试下来,filter加上端口号后性能已经基本不受影响了。