mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-09 10:43:19 -05:00
p2p: add m_network to NodeEvictionCandidate struct
This commit is contained in:
parent
7321e6f2fe
commit
4ee7aec47e
4 changed files with 6 additions and 1 deletions
|
@ -1023,7 +1023,7 @@ bool CConnman::AttemptToEvictConnection()
|
||||||
HasAllDesirableServiceFlags(node->nServices),
|
HasAllDesirableServiceFlags(node->nServices),
|
||||||
peer_relay_txes, peer_filter_not_null, node->nKeyedNetGroup,
|
peer_relay_txes, peer_filter_not_null, node->nKeyedNetGroup,
|
||||||
node->m_prefer_evict, node->addr.IsLocal(),
|
node->m_prefer_evict, node->addr.IsLocal(),
|
||||||
node->m_inbound_onion};
|
node->m_inbound_onion, node->ConnectedThroughNetwork()};
|
||||||
vEvictionCandidates.push_back(candidate);
|
vEvictionCandidates.push_back(candidate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1210,6 +1210,7 @@ struct NodeEvictionCandidate
|
||||||
bool prefer_evict;
|
bool prefer_evict;
|
||||||
bool m_is_local;
|
bool m_is_local;
|
||||||
bool m_is_onion;
|
bool m_is_onion;
|
||||||
|
Network m_network;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -32,6 +32,7 @@ FUZZ_TARGET(node_eviction)
|
||||||
/* prefer_evict */ fuzzed_data_provider.ConsumeBool(),
|
/* prefer_evict */ fuzzed_data_provider.ConsumeBool(),
|
||||||
/* m_is_local */ fuzzed_data_provider.ConsumeBool(),
|
/* m_is_local */ fuzzed_data_provider.ConsumeBool(),
|
||||||
/* m_is_onion */ fuzzed_data_provider.ConsumeBool(),
|
/* m_is_onion */ fuzzed_data_provider.ConsumeBool(),
|
||||||
|
/* m_network */ fuzzed_data_provider.PickValueInArray(ALL_NETWORKS),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Make a copy since eviction_candidates may be in some valid but otherwise
|
// Make a copy since eviction_candidates may be in some valid but otherwise
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
// Distributed under the MIT software license, see the accompanying
|
// Distributed under the MIT software license, see the accompanying
|
||||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
|
#include <netaddress.h>
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
|
#include <test/util/net.h>
|
||||||
#include <test/util/setup_common.h>
|
#include <test/util/setup_common.h>
|
||||||
|
|
||||||
#include <boost/test/unit_test.hpp>
|
#include <boost/test/unit_test.hpp>
|
||||||
|
@ -32,6 +34,7 @@ std::vector<NodeEvictionCandidate> GetRandomNodeEvictionCandidates(const int n_c
|
||||||
/* prefer_evict */ random_context.randbool(),
|
/* prefer_evict */ random_context.randbool(),
|
||||||
/* m_is_local */ random_context.randbool(),
|
/* m_is_local */ random_context.randbool(),
|
||||||
/* m_is_onion */ random_context.randbool(),
|
/* m_is_onion */ random_context.randbool(),
|
||||||
|
/* m_network */ ALL_NETWORKS[random_context.randrange(ALL_NETWORKS.size())],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return candidates;
|
return candidates;
|
||||||
|
|
Loading…
Add table
Reference in a new issue