kaspanet / rusty-kaspa

Kaspa full-node reference implementation and related libraries in the Rust programming language
ISC License
442 stars 144 forks source link

Refactor 'addressmanager', reorder fetching sources for-external ip #300

Closed biryukovmaxim closed 11 months ago

biryukovmaxim commented 11 months ago

reorder fetching sources for external ip according to: external ip -> provided local address -> net interfaces -> upnp

The 'addressmanager' component of the codebase has been thoroughly refined for improved readability and maintainability. Firstly, the logic for assigning local network addresses has been streamlined and broken down into smaller methods for more clarity. Old methods 'add_routable_addresses_from_net_interfaces' and 'configured_address' have been replaced by 'routable_addresses_from_net_interfaces', 'local_addresses', and 'upnp'. This also led to the removal of redundant code.