diff options
author | benthecarman <benthecarman@live.com> | 2019-02-04 21:26:43 -0600 |
---|---|---|
committer | benthecarman <benthecarman@live.com> | 2019-02-04 21:26:52 -0600 |
commit | 30d0f7be6e6bd45fed7195ddf31187438b02227a (patch) | |
tree | 7e26ab5135127031a6b21aeb06d07cfdff05be7d /src/rpc | |
parent | e50853501b79378597edbcd6dd217819c057de4b (diff) |
rpc: Fix for segfault if combinepsbt called with empty inputs
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/rawtransaction.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index ac2e0ff4ee..5a057cdb11 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -1514,6 +1514,9 @@ UniValue combinepsbt(const JSONRPCRequest& request) // Unserialize the transactions std::vector<PartiallySignedTransaction> psbtxs; UniValue txs = request.params[0].get_array(); + if (txs.empty()) { + throw JSONRPCError(RPC_INVALID_PARAMETER, "Parameter 'txs' cannot be empty"); + } for (unsigned int i = 0; i < txs.size(); ++i) { PartiallySignedTransaction psbtx; std::string error; |