From 6a209ba3a8c283fb2ffe78182675ad00be22c878 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Mon, 8 Feb 2016 15:38:18 -0800 Subject: [PATCH] Fix a block condition where cb is called immediately --- rpc/core/mempool.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpc/core/mempool.go b/rpc/core/mempool.go index 3e4d81b17..7befedbf8 100644 --- a/rpc/core/mempool.go +++ b/rpc/core/mempool.go @@ -20,7 +20,7 @@ func BroadcastTxAsync(tx types.Tx) (*ctypes.ResultBroadcastTx, error) { // Note: tx must be signed func BroadcastTxSync(tx types.Tx) (*ctypes.ResultBroadcastTx, error) { - resCh := make(chan *tmsp.Response) + resCh := make(chan *tmsp.Response, 1) err := mempoolReactor.BroadcastTx(tx, func(res *tmsp.Response) { resCh <- res })