[network] remove unnecessary nesting
[network] remove unnecessary nesting

This nesting adds more overhead to reading the code

Closes: #5689

libra/libra,libra/libra,libra/libra,libra/libra,aptos-labs/aptos-core,aptos-labs/aptos-core,aptos-labs/aptos-core,aptos-labs/aptos-core,aptos-labs/aptos-core,libra/libra,aptos-labs/aptos-core,aptos-labs/aptos-core