From ae909d0a09fd509467d755ae4480846c61b7da36 Mon Sep 17 00:00:00 2001 From: Alex Werner Date: Wed, 23 Aug 2017 16:21:54 +0200 Subject: [PATCH] Fix : Reject invalid instantsend transaction (#1583) --- src/rpc/rawtransaction.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index aa6927d56..2930c476e 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -865,6 +865,9 @@ UniValue sendrawtransaction(const UniValue& params, bool fHelp) bool fHaveChain = existingCoins && existingCoins->nHeight < 1000000000; if (!fHaveMempool && !fHaveChain) { // push to local node and sync with wallets + if (fInstantSend && !instantsend.ProcessTxLockRequest(tx)) { + throw JSONRPCError(RPC_TRANSACTION_ERROR, "Not a valid InstantSend transaction, see debug.log for more info"); + } CValidationState state; bool fMissingInputs; if (!AcceptToMemoryPool(mempool, state, tx, false, &fMissingInputs, false, !fOverrideFees)) { @@ -880,9 +883,6 @@ UniValue sendrawtransaction(const UniValue& params, bool fHelp) } else if (fHaveChain) { throw JSONRPCError(RPC_TRANSACTION_ALREADY_IN_CHAIN, "transaction already in block chain"); } - if (fInstantSend && !instantsend.ProcessTxLockRequest(tx)) { - throw JSONRPCError(RPC_TRANSACTION_ERROR, "Not a valid InstantSend transaction, see debug.log for more info"); - } if(!g_connman) throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled");