Fix merge mistakes

This commit is contained in:
Doyle 2020-05-27 16:57:39 +10:00
parent 0a41be69f2
commit dc5175c4eb
5 changed files with 11 additions and 75 deletions

View File

@ -688,13 +688,9 @@ namespace cryptonote
bool sync_on_blocks = true;
uint64_t sync_threshold = 1;
<<<<<<< HEAD
std::string const lns_db_file_path = m_config_folder + "/lns.db";
#if !defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS) // In integration mode, don't delete the DB. This should be explicitly done in the tests. Otherwise the more likely behaviour is persisting the DB across multiple daemons in the same test.
if (m_nettype == FAKECHAIN)
=======
if (m_nettype == FAKECHAIN && !keep_fakechain)
>>>>>>> 8136bf37e2c0a76851c0bb6482b6e4c2b653f5d7
{
// reset the db by removing the database file before opening it
if (!db->remove_data_file(filename))
@ -2510,11 +2506,7 @@ namespace cryptonote
MDEBUG("blocks in the last " << seconds[n] / 60 << " minutes: " << b << " (probability " << p << ")");
if (p < threshold)
{
<<<<<<< HEAD
MWARNING("There were " << b << " blocks in the last " << seconds[n] / 60 << " minutes, there might be large hash rate changes, or we might be partitioned, cut off from the Loki network or under attack. Or it could be just sheer bad luck.");
=======
MWARNING("There were " << b << (b == max_blocks_checked ? " or more" : "") << " blocks in the last " << seconds[n] / 60 << " minutes, there might be large hash rate changes, or we might be partitioned, cut off from the Monero network or under attack. Or it could be just sheer bad luck.");
>>>>>>> 8136bf37e2c0a76851c0bb6482b6e4c2b653f5d7
MWARNING("There were " << b << (b == max_blocks_checked ? " or more" : "") << " blocks in the last " << seconds[n] / 60 << " minutes, there might be large hash rate changes, or we might be partitioned, cut off from the Loki network or under attack. Or it could be just sheer bad luck.");
std::shared_ptr<tools::Notify> block_rate_notify = m_block_rate_notify;
if (block_rate_notify)

View File

@ -698,72 +698,33 @@ bool rpc_command_executor::print_net_stats()
return true;
}
<<<<<<< HEAD
bool rpc_command_executor::print_blockchain_info(uint64_t start_block_index, uint64_t end_block_index) {
GET_BLOCK_HEADERS_RANGE::request req{};
GET_BLOCK_HEADERS_RANGE::response res{};
=======
bool t_rpc_command_executor::print_blockchain_info(int64_t start_block_index, uint64_t end_block_index) {
cryptonote::COMMAND_RPC_GET_BLOCK_HEADERS_RANGE::request req;
cryptonote::COMMAND_RPC_GET_BLOCK_HEADERS_RANGE::response res;
epee::json_rpc::error error_resp;
std::string fail_message = "Problem fetching info";
// negative: relative to the end
if (start_block_index < 0)
{
cryptonote::COMMAND_RPC_GET_INFO::request ireq;
cryptonote::COMMAND_RPC_GET_INFO::response ires;
if (m_is_rpc)
{
if (!m_rpc_client->rpc_request(ireq, ires, "/getinfo", fail_message.c_str()))
{
return true;
}
}
else
{
if (!m_rpc_server->on_get_info(ireq, ires) || ires.status != CORE_RPC_STATUS_OK)
{
tools::fail_msg_writer() << make_error(fail_message, ires.status);
return true;
}
}
GET_INFO::response ires;
if (!invoke<GET_INFO>(GET_INFO::request{}, ires, "Failed to query daemon info"))
return false;
if (start_block_index < 0 && (uint64_t)-start_block_index >= ires.height)
{
tools::fail_msg_writer() << "start offset is larger than blockchain height";
return true;
return false;
}
start_block_index = ires.height + start_block_index;
end_block_index = start_block_index + end_block_index - 1;
}
>>>>>>> 8136bf37e2c0a76851c0bb6482b6e4c2b653f5d7
req.start_height = start_block_index;
req.end_height = end_block_index;
req.fill_pow_hash = false;
<<<<<<< HEAD
if (!invoke<GET_BLOCK_HEADERS_RANGE>(std::move(req), res, "Failed to retrieve block headers"))
return false;
=======
fail_message = "Failed calling getblockheadersrange";
if (m_is_rpc)
{
if (!m_rpc_client->json_rpc_request(req, res, "getblockheadersrange", fail_message.c_str()))
{
return true;
}
}
else
{
if (!m_rpc_server->on_get_block_headers_range(req, res, error_resp) || res.status != CORE_RPC_STATUS_OK)
{
tools::fail_msg_writer() << make_error(fail_message, res.status);
return true;
}
}
>>>>>>> 8136bf37e2c0a76851c0bb6482b6e4c2b653f5d7
bool first = true;
for (auto & header : res.headers)
@ -869,12 +830,8 @@ bool rpc_command_executor::print_block_by_height(uint64_t height, bool include_h
return print_block(std::move(req), include_hex);
}
<<<<<<< HEAD
bool rpc_command_executor::print_transaction(const crypto::hash& transaction_hash,
=======
bool t_rpc_command_executor::print_transaction(crypto::hash transaction_hash,
bool include_metadata,
>>>>>>> 8136bf37e2c0a76851c0bb6482b6e4c2b653f5d7
bool include_hex,
bool include_json) {
GET_TRANSACTIONS::request req{};

View File

@ -112,7 +112,7 @@ public:
bool print_connections();
bool print_blockchain_info(int64_t start_block_index, uint64_t end_block_index);
bool print_blockchain_info(uint64_t start_block_index, uint64_t end_block_index);
bool print_quorum_state(uint64_t start_height, uint64_t end_height);
@ -130,11 +130,7 @@ public:
bool print_block_by_height(uint64_t height, bool include_hex);
<<<<<<< HEAD
bool print_transaction(const crypto::hash& transaction_hash, bool include_hex, bool include_json);
=======
bool print_transaction(crypto::hash transaction_hash, bool include_metadata, bool include_hex, bool include_json);
>>>>>>> 8136bf37e2c0a76851c0bb6482b6e4c2b653f5d7
bool print_transaction(const crypto::hash& transaction_hash, bool include_metadata, bool include_hex, bool include_json);
bool is_key_image_spent(const crypto::key_image &ki);

View File

@ -2713,13 +2713,8 @@ namespace nodetool
}
else
{
<<<<<<< HEAD
zone.second.m_peerlist.set_peer_just_seen(pe.id, pe.adr, pe.pruning_seed, pe.rpc_port);
LOG_PRINT_L2("PEER PROMOTED TO WHITE PEER LIST IP address: " << pe.adr.host_str() << " Peer ID: " << peerid_type(pe.id));
=======
zone.second.m_peerlist.set_peer_just_seen(pe.id, pe.adr, pe.pruning_seed, pe.rpc_port, pe.rpc_credits_per_hash);
LOG_PRINT_L2("PEER PROMOTED TO WHITE PEER LIST IP address: " << pe.adr.host_str() << " Peer ID: " << peerid_to_string(pe.id));
>>>>>>> 8136bf37e2c0a76851c0bb6482b6e4c2b653f5d7
}
}
return true;

View File

@ -1590,13 +1590,9 @@ namespace wallet_rpc
{
struct request
{
<<<<<<< HEAD
std::string data; // Anything you need to sign.
=======
std::string data;
uint32_t account_index;
uint32_t address_index;
>>>>>>> 8136bf37e2c0a76851c0bb6482b6e4c2b653f5d7
uint32_t account_index; // The account to use for signing
uint32_t address_index; // The subaddress in the account to sign with
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(data)