diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp index a495498b2f..9f306581f5 100755 --- a/src/blockchain_db/lmdb/db_lmdb.cpp +++ b/src/blockchain_db/lmdb/db_lmdb.cpp @@ -1999,6 +1999,9 @@ bool BlockchainLMDB::get_txpool_tx_blob(const crypto::hash& txid, cryptonote::bl if (result != 0) throw1(DB_ERROR(lmdb_error("Error finding txpool tx blob: ", result).c_str())); + if (v.mv_size == 0) + throw1(DB_ERROR("Error finding txpool tx blob: tx is present, but data is empty")); + bd.assign(reinterpret_cast(v.mv_data), v.mv_size); return true; } diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index af8b9a0c85..c6818a53d1 100755 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -1156,7 +1156,13 @@ namespace cryptonote tx_info.tvc.m_too_big = true; return; } - + else if (tx_info.blob->empty()) + { + LOG_PRINT_L1("WRONG TRANSACTION BLOB, blob is empty, rejected"); + tx_info.tvc.m_verifivation_failed = true; + return; + } + tx_info.parsed = parse_and_validate_tx_from_blob(*tx_info.blob, tx_info.tx, tx_info.tx_hash); if(!tx_info.parsed) { diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl index 1eba26babc..fd3432c6d8 100755 --- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl +++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl @@ -2646,17 +2646,17 @@ skip: bool t_cryptonote_protocol_handler::relay_transactions(NOTIFY_NEW_TRANSACTIONS::request& arg, cryptonote_connection_context& exclude_context) { MTRACE("relay_transactions"); - for(auto& tx_blob : arg.txs) - m_core.on_transaction_relayed(tx_blob); // no check for success, so tell core they're relayed unconditionally and snag a copy of the // hash so that we can look up any associated flash data we should include. + std::vector relayed_txes; relayed_txes.reserve(arg.txs.size()); for (auto &tx_blob : arg.txs) - relayed_txes.push_back( - m_core.on_transaction_relayed(tx_blob) - ); + { + if (auto hash = m_core.on_transaction_relayed(tx_blob)) + relayed_txes.push_back(hash); + } // Rebuild arg.flashes from flash data that we have because we don't necessarily have the same // flash data that got sent to us (we may have additional flash info, or may have rejected some diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index 3028d052c3..f333068c7f 100755 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -3065,9 +3065,21 @@ namespace cryptonote { namespace rpc { entry.decommission_count = info.decommission_count; entry.last_decommission_reason_consensus_all = info.last_decommission_reason_consensus_all; entry.last_decommission_reason_consensus_any = info.last_decommission_reason_consensus_any; - - auto& netconf = m_core.get_net_config(); - m_core.get_master_node_list().access_proof(mn_info.pubkey, [&entry, &netconf](const auto &proof) { + m_core.get_master_node_list().access_proof(mn_info.pubkey, [ + this, &entry, is_me = (m_core.master_node() && m_core.get_master_keys().pub == mn_info.pubkey) + ](const auto &proof) { + if (is_me) { + entry.master_node_version = BELDEX_VERSION; + entry.belnet_version = m_core.belnet_version; + entry.storage_server_version = m_core.ss_version; + entry.public_ip = epee::string_tools::get_ip_string_from_int32(m_core.mn_public_ip()); + entry.storage_port = m_core.storage_https_port(); + entry.storage_lmq_port = m_core.storage_omq_port(); + entry.quorumnet_port = m_core.quorumnet_port(); + entry.pubkey_ed25519 = tools::type_to_hex(m_core.get_master_keys().pub_ed25519); + entry.pubkey_x25519 = tools::type_to_hex(m_core.get_master_keys().pub_x25519); + } + else{ entry.master_node_version = proof.proof->version; entry.belnet_version = proof.proof->belnet_version; entry.storage_server_version = proof.proof->storage_server_version; @@ -3077,11 +3089,12 @@ namespace cryptonote { namespace rpc { entry.pubkey_ed25519 = proof.proof->pubkey_ed25519 ? tools::type_to_hex(proof.proof->pubkey_ed25519) : ""; entry.pubkey_x25519 = proof.pubkey_x25519 ? tools::type_to_hex(proof.pubkey_x25519) : ""; entry.quorumnet_port = proof.proof->qnet_port; - + } // NOTE: Master Node Testing entry.last_uptime_proof = proof.timestamp; auto system_now = std::chrono::system_clock::now(); auto steady_now = std::chrono::steady_clock::now(); + auto& netconf = m_core.get_net_config(); entry.storage_server_reachable = !proof.ss_reachable.unreachable_for(netconf.UPTIME_PROOF_VALIDITY - netconf.UPTIME_PROOF_FREQUENCY, steady_now); entry.storage_server_first_unreachable = reachable_to_time_t(proof.ss_reachable.first_unreachable, system_now, steady_now); entry.storage_server_last_unreachable = reachable_to_time_t(proof.ss_reachable.last_unreachable, system_now, steady_now);