mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Add [overlay] configuration section (experimental):
This configuration section uses the new BasicConfig interface that supports key-value pairs in the section. Some exposition is added to the example cfg file. The new settings for overlay are related to the Hub and Spoke feature which is currently in development. Production servers should not set these configuration options, they are clearly marked experimental in the example cfg file. Conflicts: src/ripple/overlay/impl/OverlayImpl.cpp src/ripple/overlay/impl/OverlayImpl.h src/ripple/overlay/impl/PeerImp.cpp src/ripple/overlay/impl/PeerImp.h
This commit is contained in:
@@ -71,6 +71,17 @@ OverlayImpl::OverlayImpl (Stoppable& parent,
|
||||
, m_resolver (resolver)
|
||||
, m_nextShortId (0)
|
||||
{
|
||||
auto const& section = getConfig()["overlay"];
|
||||
set (setup_.use_handshake, "use_handshake", section);
|
||||
set (setup_.auto_connect, "auto_connect", section);
|
||||
std::string promote;
|
||||
set (promote, "become_superpeer", section);
|
||||
if (promote == "never")
|
||||
setup_.promote = Promote::never;
|
||||
else if (promote == "always")
|
||||
setup_.promote = Promote::always;
|
||||
else
|
||||
setup_.promote = Promote::automatic;
|
||||
}
|
||||
|
||||
OverlayImpl::~OverlayImpl ()
|
||||
@@ -83,6 +94,12 @@ OverlayImpl::~OverlayImpl ()
|
||||
return this->m_child_count == 0; });
|
||||
}
|
||||
|
||||
OverlayImpl::Setup const&
|
||||
OverlayImpl::setup() const
|
||||
{
|
||||
return setup_;
|
||||
}
|
||||
|
||||
void
|
||||
OverlayImpl::accept (socket_type&& socket)
|
||||
{
|
||||
@@ -436,10 +453,10 @@ OverlayImpl::getActivePeers ()
|
||||
|
||||
ret.reserve (m_publicKeyMap.size ());
|
||||
|
||||
for (auto const& pair : m_publicKeyMap)
|
||||
for (auto const& e : m_publicKeyMap)
|
||||
{
|
||||
assert (pair.second);
|
||||
ret.push_back (pair.second);
|
||||
assert (e.second);
|
||||
ret.push_back (e.second);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user