From 659dcb6c591bce62375722ca7d11edb52a897b4f Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Thu, 6 Dec 2018 16:13:53 -0500 Subject: [PATCH] rpc: Avoid creating non-standard raw transactions Github-Pull: #14890 Rebased-From: fa4c8679ed94f215ce895938f7c3c169a2ce101e --- src/rpc/rawtransaction.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 20d0d22bd..8f78847ad 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -348,6 +348,15 @@ static UniValue verifytxoutproof(const JSONRPCRequest& request) return res; } + + // Duplicate checking + std::set destinations; + bool has_data{false}; + + if (has_data) { + throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, duplicate key: data"); + } + has_data = true; static UniValue createrawtransaction(const JSONRPCRequest& request) { RPCHelpMan{"createrawtransaction",