From 7d4f95ca535adeea67485d010b591eb6960e791f Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Tue, 3 Dec 2019 04:16:17 +0100 Subject: [PATCH] fixed problem with seed nodes + transactions loaded to onboard container instead of prevalidation in tx pool --- .../currency_protocol_handler.inl | 21 +++++++++++++------ src/p2p/net_node.inl | 16 +++++++------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/src/currency_protocol/currency_protocol_handler.inl b/src/currency_protocol/currency_protocol_handler.inl index c3c224d2..db0dc3f6 100644 --- a/src/currency_protocol/currency_protocol_handler.inl +++ b/src/currency_protocol/currency_protocol_handler.inl @@ -529,27 +529,36 @@ namespace currency { CHECK_STOP_FLAG__DROP_AND_RETURN_IF_SET(1, "Blocks processing interrupted, connection dropped"); + block_verification_context bvc = boost::value_initialized(); //process transactions TIME_MEASURE_START(transactions_process_time); for (const auto& tx_blob : block_entry.txs) { CHECK_STOP_FLAG__DROP_AND_RETURN_IF_SET(1, "Block txs processing interrupted, connection dropped"); - - tx_verification_context tvc = AUTO_VAL_INIT(tvc); - m_core.handle_incoming_tx(tx_blob, tvc, true); - if(tvc.m_verification_failed) + crypto::hash tx_id = null_hash; + transaction tx = AUTO_VAL_INIT(tx); + if (!parse_and_validate_tx_from_blob(tx_blob, tx, tx_id)) { - LOG_ERROR_CCONTEXT("transaction verification failed on NOTIFY_RESPONSE_GET_OBJECTS, \r\ntx_id = " + LOG_ERROR_CCONTEXT("failed to parse tx: " << string_tools::pod_to_hex(get_blob_hash(tx_blob)) << ", dropping connection"); m_p2p->drop_connection(context); return 1; } + bvc.m_onboard_transactions[tx_id] = tx; +// tx_verification_context tvc = AUTO_VAL_INIT(tvc); +// m_core.handle_incoming_tx(tx_blob, tvc, true); +// if(tvc.m_verification_failed) +// { +// LOG_ERROR_CCONTEXT("transaction verification failed on NOTIFY_RESPONSE_GET_OBJECTS, \r\ntx_id = " +// << string_tools::pod_to_hex(get_blob_hash(tx_blob)) << ", dropping connection"); +// m_p2p->drop_connection(context); +// return 1; +// } } TIME_MEASURE_FINISH(transactions_process_time); //process block TIME_MEASURE_START(block_process_time); - block_verification_context bvc = boost::value_initialized(); m_core.handle_incoming_block(block_entry.block, bvc, false); if (count > 2 && bvc.m_already_exists) diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index 8557f89e..c70b45d7 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -276,14 +276,14 @@ namespace nodetool #ifndef TESTNET //TODO: //ADD_HARDCODED_SEED_NODE(std::string("0.0.0.0:") + std::to_string(P2P_DEFAULT_PORT)); - ADD_HARDCODED_SEED_NODE("95.217.43.225:", P2P_DEFAULT_PORT); - ADD_HARDCODED_SEED_NODE("94.130.137.230:", P2P_DEFAULT_PORT); - ADD_HARDCODED_SEED_NODE("95.217.42.247:", P2P_DEFAULT_PORT); - ADD_HARDCODED_SEED_NODE("94.130.160.115:", P2P_DEFAULT_PORT); - ADD_HARDCODED_SEED_NODE("195.201.107.230:", P2P_DEFAULT_PORT); - ADD_HARDCODED_SEED_NODE("95.217.46.49:", P2P_DEFAULT_PORT); - ADD_HARDCODED_SEED_NODE("159.69.76.144:", P2P_DEFAULT_PORT); - ADD_HARDCODED_SEED_NODE("144.76.183.143:", P2P_DEFAULT_PORT); + ADD_HARDCODED_SEED_NODE("95.217.43.225", P2P_DEFAULT_PORT); + ADD_HARDCODED_SEED_NODE("94.130.137.230", P2P_DEFAULT_PORT); + ADD_HARDCODED_SEED_NODE("95.217.42.247", P2P_DEFAULT_PORT); + ADD_HARDCODED_SEED_NODE("94.130.160.115", P2P_DEFAULT_PORT); + ADD_HARDCODED_SEED_NODE("195.201.107.230", P2P_DEFAULT_PORT); + ADD_HARDCODED_SEED_NODE("95.217.46.49", P2P_DEFAULT_PORT); + ADD_HARDCODED_SEED_NODE("159.69.76.144", P2P_DEFAULT_PORT); + ADD_HARDCODED_SEED_NODE("144.76.183.143", P2P_DEFAULT_PORT); #else //TODO: ADD_HARDCODED_SEED_NODE("95.217.43.225", P2P_DEFAULT_PORT);