From d9340ce9124ecc4c3588a411de6868fd8f995074 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 20 Nov 2017 12:18:52 -0800 Subject: [PATCH] Fix sendrawtransaction hang when sending a tx already in mempool --- src/rpc/rawtransaction.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index e65959bf0e..3aff1e9fbf 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -970,6 +970,10 @@ UniValue sendrawtransaction(const JSONRPCRequest& request) } } else if (fHaveChain) { throw JSONRPCError(RPC_TRANSACTION_ALREADY_IN_CHAIN, "transaction already in block chain"); + } else { + // Make sure we don't block forever if re-sending + // a transaction already in mempool. + promise.set_value(); } } // cs_main