From daa76dcff008f9cd095594387ec9eafa872111ab Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Fri, 25 Mar 2016 08:29:03 -0700 Subject: [PATCH] Fix CheckTx/Update race condition --- mempool/mempool.go | 1 + 1 file changed, 1 insertion(+) diff --git a/mempool/mempool.go b/mempool/mempool.go index 4385f385f..0744880a1 100644 --- a/mempool/mempool.go +++ b/mempool/mempool.go @@ -216,6 +216,7 @@ func (mem *Mempool) collectTxs(maxTxs int) []types.Tx { func (mem *Mempool) Update(height int, txs []types.Tx) { mem.proxyMtx.Lock() 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. txsMap := make(map[string]struct{})