From e8e6c83fa8a56cd7bc76a79207d8850c53743f2a Mon Sep 17 00:00:00 2001 From: "crypro.zoidberg" Date: Fri, 10 May 2019 21:48:29 +0200 Subject: [PATCH] attempt to fix broken PoS relay --- src/currency_protocol/currency_protocol_handler.inl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/currency_protocol/currency_protocol_handler.inl b/src/currency_protocol/currency_protocol_handler.inl index b281e5c3..60c4bcf3 100644 --- a/src/currency_protocol/currency_protocol_handler.inl +++ b/src/currency_protocol/currency_protocol_handler.inl @@ -258,6 +258,11 @@ namespace currency } //pre-validate block here, and propagate it to network asap to avoid latency of handling big block (tx flood) + //######################################################## + /* + problem with prevalidation: in case of pre_validate_block() is passed but handle_incoming_tx() is failed + network got spammed with notifications about this broken block and then connections got closed. + temporary disabled to more investigation bool prevalidate_relayed = false; if (m_core.pre_validate_block(b, bvc, block_id) && bvc.m_added_to_main_chain) { @@ -266,6 +271,8 @@ namespace currency relay_block(arg, context); prevalidate_relayed = true; } + */ + //######################################################## //now actually process block for(auto tx_blob_it = arg.b.txs.begin(); tx_blob_it!=arg.b.txs.end();tx_blob_it++) @@ -297,7 +304,7 @@ namespace currency if (bvc.m_added_to_main_chain || (bvc.added_to_altchain && bvc.height_difference < 2)) { - if (!prevalidate_relayed) + if (true/*!prevalidate_relayed*/) { // pre-validation failed prevoiusly, but complete check was success, not an alternative block ++arg.hop;