Browse Source

Fix CheckTx/Update race condition

pull/206/merge
Jae Kwon 9 years ago
parent
commit
daa76dcff0
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      mempool/mempool.go

+ 1
- 0
mempool/mempool.go View File

@ -216,6 +216,7 @@ func (mem *Mempool) collectTxs(maxTxs int) []types.Tx {
func (mem *Mempool) Update(height int, txs []types.Tx) { func (mem *Mempool) Update(height int, txs []types.Tx) {
mem.proxyMtx.Lock() mem.proxyMtx.Lock()
defer mem.proxyMtx.Unlock() defer mem.proxyMtx.Unlock()
mem.proxyAppConn.FlushSync() // To flush async resCb calls e.g. from CheckTx
// First, create a lookup map of txns in new txs. // First, create a lookup map of txns in new txs.
txsMap := make(map[string]struct{}) txsMap := make(map[string]struct{})


Loading…
Cancel
Save