Skip to content

Commit

Permalink
Merge PR: fix swap ws 167 (#2943)
Browse files Browse the repository at this point in the history
* fix swap websocket

* fix swap websocket
  • Loading branch information
chengzhinei authored Feb 6, 2023
1 parent bcfcd4f commit 0a05d48
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions libs/tendermint/state/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,16 +240,14 @@ func (blockExec *BlockExecutor) ApplyBlock(

abciResponses, duration, err := blockExec.runAbci(block, deltaInfo)

// Events are fired after runAbci.
// publish event
if types.EnableEventBlockTime {
blockExec.FireBlockTimeEvents(block.Height, len(block.Txs), true)
}
// NOTE: if we crash between Commit and Save, events wont be fired during replay
if !blockExec.isNullIndexer {
blockExec.eventsChan <- event{
block: block,
abciRsp: abciResponses,
if !blockExec.isNullIndexer {
blockExec.eventsChan <- event{
block: block,
abciRsp: abciResponses,
}
}
}

Expand Down Expand Up @@ -316,6 +314,17 @@ func (blockExec *BlockExecutor) ApplyBlock(

dc.postApplyBlock(block.Height, deltaInfo, abciResponses, commitResp.DeltaMap, blockExec.isFastSync)

// Events are fired after everything else.
// NOTE: if we crash between Commit and Save, events wont be fired during replay
if !types.EnableEventBlockTime {
if !blockExec.isNullIndexer {
blockExec.eventsChan <- event{
block: block,
abciRsp: abciResponses,
}
}
}

return state, retainHeight, nil
}

Expand Down

0 comments on commit 0a05d48

Please sign in to comment.