From 1f3beba32acda451e79bd0eae9f2404988d3c833 Mon Sep 17 00:00:00 2001 From: Vlad Dobromyslov Date: Mon, 29 Aug 2022 15:31:42 +0300 Subject: [PATCH] Don't send transaction that is not signed --- .../peerplays_sidechain/sidechain_net_handler_ethereum.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/plugins/peerplays_sidechain/sidechain_net_handler_ethereum.cpp b/libraries/plugins/peerplays_sidechain/sidechain_net_handler_ethereum.cpp index 8ceb582b..52d401cb 100644 --- a/libraries/plugins/peerplays_sidechain/sidechain_net_handler_ethereum.cpp +++ b/libraries/plugins/peerplays_sidechain/sidechain_net_handler_ethereum.cpp @@ -544,6 +544,11 @@ std::string sidechain_net_handler_ethereum::send_sidechain_transaction(const sid boost::property_tree::ptree pt_array; for (const auto &signature : sto.signatures) { const auto &transaction = signature.second; + + //! Check if we have this signed transaction, if not, don't send it + if(transaction.empty()) + continue; + #ifdef SEND_RAW_TRANSACTION const std::string sidechain_transaction = rpc_client->eth_send_raw_transaction(transaction); #else @@ -562,6 +567,7 @@ std::string sidechain_net_handler_ethereum::send_sidechain_transaction(const sid //! Fixme //! How should we proceed with error in eth_send_transaction elog("Error in eth_send_transaction for transaction ${id}, transaction ${transaction}", ("id", sto.id)("transaction", transaction)); + return std::string{}; //! Return empty string, as we have error in sending } } pt.add_child("result_array", pt_array);