From 19f8837399ec4b29bc50cb46e86795470f80c434 Mon Sep 17 00:00:00 2001 From: Benjamin Bollen <ben@monax.io> Date: Fri, 31 Mar 2017 20:13:14 +0200 Subject: [PATCH] client: websocket waiting for result on call missed due to belated NewBlock event; remove redundant check --- client/websocket_client.go | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/client/websocket_client.go b/client/websocket_client.go index 2019e2db..066579c0 100644 --- a/client/websocket_client.go +++ b/client/websocket_client.go @@ -111,15 +111,20 @@ func (erisNodeWebsocketClient *erisNodeWebsocketClient) WaitForConfirmation(tx t continue } - blockData, ok := event.Data.(txs.EventDataNewBlock) - if ok { - latestBlockHash = blockData.Block.Hash() - logging.TraceMsg(erisNodeWebsocketClient.logger, "Registered new block", - "block", blockData.Block, - "latest_block_hash", latestBlockHash, - ) - continue - } + // NOTE: [ben] hotfix on 0.16.1 because NewBlock events looks to arrive late + // both in tests; so we now miss events; This check is safely removed because + // for CallTx on checking the transaction the EVM is not run and no false positive event + // is sent; neither is this check a good check for that. + + // blockData, ok := event.Data.(txs.EventDataNewBlock) + // if ok { + // latestBlockHash = blockData.Block.Hash() + // logging.TraceMsg(erisNodeWebsocketClient.logger, "Registered new block", + // "block", blockData.Block, + // "latest_block_hash", latestBlockHash, + // ) + // continue + // } // we don't accept events unless they came after a new block (ie. in) if latestBlockHash == nil { -- GitLab