rpc: Only show version string if it matches expected pattern

This commit is contained in:
Nathan Dorfman 2019-11-12 15:41:05 -07:00
parent 3293780992
commit dce6f055f9
6 changed files with 153 additions and 2 deletions

View file

@ -38,6 +38,7 @@
#include "cryptonote_basic/difficulty.h"
#include "cryptonote_basic/hardfork.h"
#include "rpc/rpc_payment_signature.h"
#include "rpc/rpc_version_str.h"
#include <boost/format.hpp>
#include <ctime>
#include <string>
@ -2465,7 +2466,7 @@ bool t_rpc_command_executor::version()
}
}
if (res.version.empty())
if (res.version.empty() || !cryptonote::rpc::is_version_string_valid(res.version))
{
tools::fail_msg_writer() << "The daemon software version is not available.";
}