mirror of
https://github.com/oxen-io/oxen-core.git
synced 2023-12-14 02:22:56 +01:00
Only set bootstrap info if admin
Later on we restrict this, but are leaking it to non-admin users if we hit this case. (The caller is meant to check .untrusted to tell if the info came from a bootstrap node).
This commit is contained in:
parent
cf1ff3575e
commit
5ff901e446
|
@ -349,17 +349,19 @@ namespace cryptonote { namespace rpc {
|
|||
PERF_TIMER(on_get_info);
|
||||
if (use_bootstrap_daemon_if_necessary<GET_INFO>(req, res))
|
||||
{
|
||||
if (context.admin)
|
||||
{
|
||||
crypto::hash top_hash;
|
||||
m_core.get_blockchain_top(res.height_without_bootstrap.emplace(), top_hash);
|
||||
++*res.height_without_bootstrap; // turn top block height into blockchain height
|
||||
res.was_bootstrap_ever_used = true;
|
||||
|
||||
std::shared_lock lock{m_bootstrap_daemon_mutex};
|
||||
if (m_bootstrap_daemon.get() != nullptr)
|
||||
{
|
||||
res.bootstrap_daemon_address = m_bootstrap_daemon->address();
|
||||
}
|
||||
}
|
||||
crypto::hash top_hash;
|
||||
m_core.get_blockchain_top(res.height_without_bootstrap.emplace(), top_hash);
|
||||
++*res.height_without_bootstrap; // turn top block height into blockchain height
|
||||
res.was_bootstrap_ever_used = true;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue