node.h includes addrdb.h just for the sake of banmap_t type.
This PR makes dependencies simpler and explicit.
~Also needless typedef has been removed from enum BanReason.~
node.h includes addrdb.h just for the sake of banmap_t type.
This PR makes dependencies simpler and explicit.
~Also needless typedef has been removed from enum BanReason.~
The touched code was originated by @jonasschnelli in #6310 (409bccfbf52b531b2a9d60ac2308f56223931a2e).
Concept ACK
Thanks for cleaning this up.
Another header inconsistency that I think is worth cleaning up is the mismatch between core_io.h ⇄ core_write.cpp/core_read.cpp.
I think we should have:
core_io.h ⇄ core_io.cpp, orcore_read.h ⇄ core_read.cpp and core_write.h ⇄ core_write.cppThis inconsistency makes it harder to reason about our header dependencies programmatically (such as the analysis performed in #16659) :)
This inconsistency makes it harder to reason about our header dependencies programmatically (such as the analysis performed in #16659) :)
I saw your #16659 (comment) ;)
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
No conflicts as of last run.
25 | -} BanReason; 26 | +enum BanReason { 27 | + BanReasonUnknown, 28 | + BanReasonNodeMisbehaving, 29 | + BanReasonManuallyAdded 30 | +};
This is just asking to be a enum class.
It is not trivial as it involves (de)serialization, and requires some static_casts. Could we leave it out of this PR scope?
Please drop c9862883713ca3ee008444e132d961266331397f then, it's unrelated to the PR goal and it's already generating unnecessary "noise".
Yes, please make it fully move-only then.
Agree.
ACK f44abe4bed25a40145ab168adc1589f5df4146f3
ACK f44abe4bed25a40145ab168adc1589f5df4146f3