Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes #217

Merged
merged 4 commits into from
Nov 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.6)
cmake_minimum_required(VERSION 3.0)

include(CheckCXXCompilerFlag)
set(VERSION "6.4.9")
Expand All @@ -12,7 +12,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)

set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_CONFIGURATION_TYPES Debug RelWithDebInfo Release CACHE STRING INTERNAL)
set(CMAKE_SKIP_INSTALL_RULES ON)
set(CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY ON)
set(CMAKE_SUPPRESS_REGENERATION ON)

Expand Down
1 change: 0 additions & 1 deletion src/CryptoNoteConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,4 +283,3 @@ namespace CryptoNote

} // namespace CryptoNote

#define ALLOW_DEBUG_COMMANDS
1 change: 1 addition & 0 deletions src/CryptoNoteCore/TransactionExtra.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#pragma once

#include <algorithm>
#include <string>
#include <vector>
#include <boost/variant.hpp>
Expand Down
19 changes: 0 additions & 19 deletions src/NodeRpcProxy/NodeRpcProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,25 +500,6 @@ std::error_code NodeRpcProxy::doGetNewBlocks(std::vector<Crypto::Hash>& knownBlo
return ec;
}

std::error_code NodeRpcProxy::doGetBlock(const uint32_t blockHeight, f_block_details_response& block)
{
COMMAND_RPC_GET_BLOCK_DETAILS_BY_HEIGHT::request req = AUTO_VAL_INIT(req);
COMMAND_RPC_GET_BLOCK_DETAILS_BY_HEIGHT::response resp = AUTO_VAL_INIT(resp);

req.blockHeight = blockHeight;

std::error_code ec = jsonCommand("get_block_details_by_height", req, resp);

if (ec)
{
return ec;
}

block = std::move(resp.block);

return ec;
}

std::error_code NodeRpcProxy::doGetTransactionOutsGlobalIndices(const Crypto::Hash& transactionHash,
std::vector<uint32_t>& outsGlobalIndices) {
CryptoNote::COMMAND_RPC_GET_TX_GLOBAL_OUTPUTS_INDEXES::request req = AUTO_VAL_INIT(req);
Expand Down
1 change: 0 additions & 1 deletion src/NodeRpcProxy/NodeRpcProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ class NodeRpcProxy : public CryptoNote::INode {
std::error_code doRelayTransaction(const CryptoNote::Transaction& transaction);
std::error_code doGetRandomOutsByAmounts(std::vector<uint64_t>& amounts, uint64_t outsCount,
std::vector<COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::outs_for_amount>& result);
std::error_code doGetBlock(const uint32_t blockHeight, f_block_details_response& block);

std::error_code doGetNewBlocks(std::vector<Crypto::Hash>& knownBlockIds,
std::vector<CryptoNote::block_complete_entry>& newBlocks, uint32_t& startHeight);
Expand Down
2 changes: 2 additions & 0 deletions src/P2p/NetNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,9 @@ namespace CryptoNote
//only in case if we really sure that we have external visible ip
m_have_address = true;
m_ip_address = 0;
#ifdef ALLOW_DEBUG_COMMANDS
m_last_stat_request_time = 0;
#endif

//configure self
// m_net_server.get_config_object().m_pcommands_handler = this;
Expand Down
8 changes: 4 additions & 4 deletions src/P2p/NetNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,15 @@ namespace CryptoNote
int handle_ping(int command, COMMAND_PING::request& arg, COMMAND_PING::response& rsp, P2pConnectionContext& context);

#ifdef ALLOW_DEBUG_COMMANDS
int handle_get_stat_info(int command, COMMAND_REQUEST_STAT_INFO::request& arg, COMMAND_REQUEST_STAT_INFO::response& rsp, P2pConnectionContext& context);
int handle_get_network_state(int command, COMMAND_REQUEST_NETWORK_STATE::request& arg, COMMAND_REQUEST_NETWORK_STATE::response& rsp, P2pConnectionContext& context);
int handle_get_peer_id(int command, COMMAND_REQUEST_PEER_ID::request& arg, COMMAND_REQUEST_PEER_ID::response& rsp, P2pConnectionContext& context);
int handle_get_stat_info(int command, COMMAND_REQUEST_STAT_INFO::request &arg, COMMAND_REQUEST_STAT_INFO::response &rsp, P2pConnectionContext &context);
int handle_get_network_state(int command, COMMAND_REQUEST_NETWORK_STATE::request &arg, COMMAND_REQUEST_NETWORK_STATE::response &rsp, P2pConnectionContext &context);
int handle_get_peer_id(int command, COMMAND_REQUEST_PEER_ID::request &arg, COMMAND_REQUEST_PEER_ID::response &rsp, P2pConnectionContext &context);
bool check_trust(const proof_of_trust &tr);
#endif

bool init_config();
bool make_default_config();
bool store_config();
bool check_trust(const proof_of_trust& tr);
void initUpnp();

bool handshake(CryptoNote::LevinProtocol& proto, P2pConnectionContext& context, bool just_take_peerlist = false);
Expand Down
6 changes: 3 additions & 3 deletions src/Rpc/CoreRpcServerCommandsDefinitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ struct COMMAND_RPC_GET_BLOCK_TIMESTAMP_BY_HEIGHT
{
struct request
{
uint32_t height;
uint64_t height;

void serialize(ISerializer &s)
{
Expand All @@ -897,11 +897,11 @@ struct COMMAND_RPC_GET_BLOCK_DETAILS_BY_HEIGHT
{
struct request
{
uint32_t blockHeight;
uint64_t height;

void serialize(ISerializer &s)
{
KV_MEMBER(blockHeight)
KV_MEMBER(height)
}
};

Expand Down
Loading