Analyzing the usage of LookupSubNet
, noticed that most cases uses check if the subnet is valid by calling subnet.IsValid()
, and the boolean returned by LookupSubNet
hasn’t been used so much, see:
https://github.com/bitcoin/bitcoin/blob/29d540b7ada890dd588c4825d40c27c5e6f20061/src/httpserver.cpp#L172-L174
https://github.com/bitcoin/bitcoin/blob/29d540b7ada890dd588c4825d40c27c5e6f20061/src/net_permissions.cpp#L114-L116
It makes sense to return CSubNet
instead of bool
.