Merge bitcoin/bitcoin#29968: refactor: Avoid unused-variable warning in init.cpp

fa9abf9688 refactor: Avoid unused-variable warning in init.cpp (MarcoFalke)

Pull request description:

  Fixes https://github.com/bitcoin/bitcoin/pull/27679#discussion_r1580606777

ACKs for top commit:
  TheCharlatan:
    ACK fa9abf9688

Tree-SHA512: dcf56d7aa68578ba611a2dc591de036ab1d08f7f4dfb35d325ecf7241d8e17abc0af7005b96c44da9777adc36961b4da7fdde282a1ab0e0a6f229c8108923101
This commit is contained in:
merge-script 2024-05-02 21:09:14 +08:00
commit 3d28725134
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1

View file

@ -1297,7 +1297,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
}
}
for (const auto &port_option : std::vector<std::pair<std::string, bool>>{
for ([[maybe_unused]] const auto& [arg, unix] : std::vector<std::pair<std::string, bool>>{
// arg name UNIX socket support
{"-i2psam", false},
{"-onion", true},
@ -1309,10 +1309,8 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
{"-zmqpubhashtx", true},
{"-zmqpubrawblock", true},
{"-zmqpubrawtx", true},
{"-zmqpubsequence", true}
{"-zmqpubsequence", true},
}) {
const std::string arg{port_option.first};
const bool unix{port_option.second};
for (const std::string& socket_addr : args.GetArgs(arg)) {
std::string host_out;
uint16_t port_out{0};