mirror of
https://github.com/fluencelabs/tendermint
synced 2025-08-01 04:31:57 +00:00
fixes from Bucky's review 2
This commit is contained in:
@@ -311,13 +311,13 @@ func (w *WSEvents) eventListener() {
|
||||
continue
|
||||
}
|
||||
result := new(ctypes.ResultEvent)
|
||||
err = json.Unmarshal(*resp.Result, result)
|
||||
err := json.Unmarshal(*resp.Result, result)
|
||||
if err != nil {
|
||||
// ignore silently (eg. subscribe, unsubscribe and maybe other events)
|
||||
// TODO: ?
|
||||
continue
|
||||
}
|
||||
if ch := getSubscription(result.Query); ch != nil {
|
||||
if ch := w.getSubscription(result.Query); ch != nil {
|
||||
ch <- result.Data
|
||||
}
|
||||
case <-w.quit:
|
||||
|
@@ -158,8 +158,8 @@ func BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error) {
|
||||
err := eventBus.Subscribe(ctx, "mempool", q, deliverTxResCh)
|
||||
if err != nil {
|
||||
err = errors.Wrap(err, "failed to subscribe to tx")
|
||||
logger.Error("Error broadcasting transaction", "err", err)
|
||||
return nil, fmt.Errorf("Error broadcasting transaction: %v", err)
|
||||
logger.Error("Error on broadcastTxCommit", "err", err)
|
||||
return nil, fmt.Errorf("Error on broadcastTxCommit: %v", err)
|
||||
}
|
||||
defer eventBus.Unsubscribe(context.Background(), "mempool", q)
|
||||
|
||||
@@ -169,8 +169,8 @@ func BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error) {
|
||||
checkTxResCh <- res
|
||||
})
|
||||
if err != nil {
|
||||
logger.Error("Error broadcasting transaction", "err", err)
|
||||
return nil, fmt.Errorf("Error broadcasting transaction: %v", err)
|
||||
logger.Error("Error on broadcastTxCommit", "err", err)
|
||||
return nil, fmt.Errorf("Error on broadcastTxCommit: %v", err)
|
||||
}
|
||||
checkTxRes := <-checkTxResCh
|
||||
checkTxR := checkTxRes.GetCheckTx()
|
||||
|
@@ -50,7 +50,7 @@ var (
|
||||
addrBook *p2p.AddrBook
|
||||
txIndexer txindex.TxIndexer
|
||||
consensusReactor *consensus.ConsensusReactor
|
||||
eventBus *types.EventBus
|
||||
eventBus *types.EventBus // thread safe
|
||||
|
||||
logger log.Logger
|
||||
)
|
||||
|
Reference in New Issue
Block a user