@@ -645,7 +645,7 @@ static UniValue combinerawtransaction(const JSONRPCRequest& request)
645645
646646 for (unsigned int idx = 0 ; idx < txs.size (); idx++) {
647647 if (!DecodeHexTx (txVariants[idx], txs[idx].get_str ())) {
648- throw JSONRPCError (RPC_DESERIALIZATION_ERROR, strprintf (" TX decode failed for tx %d" , idx));
648+ throw JSONRPCError (RPC_DESERIALIZATION_ERROR, strprintf (" TX decode failed for tx %d. Make sure the tx has at least one input. " , idx));
649649 }
650650 }
651651
@@ -767,7 +767,7 @@ static UniValue signrawtransactionwithkey(const JSONRPCRequest& request)
767767
768768 CMutableTransaction mtx;
769769 if (!DecodeHexTx (mtx, request.params [0 ].get_str ())) {
770- throw JSONRPCError (RPC_DESERIALIZATION_ERROR, " TX decode failed" );
770+ throw JSONRPCError (RPC_DESERIALIZATION_ERROR, " TX decode failed. Make sure the tx has at least one input. " );
771771 }
772772
773773 FillableSigningProvider keystore;
@@ -831,10 +831,10 @@ static UniValue sendrawtransaction(const JSONRPCRequest& request)
831831 UniValueType (), // VNUM or VSTR, checked inside AmountFromValue()
832832 });
833833
834- // parse hex string from parameter
835834 CMutableTransaction mtx;
836- if (!DecodeHexTx (mtx, request.params [0 ].get_str ()))
837- throw JSONRPCError (RPC_DESERIALIZATION_ERROR, " TX decode failed" );
835+ if (!DecodeHexTx (mtx, request.params [0 ].get_str ())) {
836+ throw JSONRPCError (RPC_DESERIALIZATION_ERROR, " TX decode failed. Make sure the tx has at least one input." );
837+ }
838838 CTransactionRef tx (MakeTransactionRef (std::move (mtx)));
839839
840840 const CFeeRate max_raw_tx_fee_rate = request.params [1 ].isNull () ?
@@ -905,7 +905,7 @@ static UniValue testmempoolaccept(const JSONRPCRequest& request)
905905
906906 CMutableTransaction mtx;
907907 if (!DecodeHexTx (mtx, request.params [0 ].get_array ()[0 ].get_str ())) {
908- throw JSONRPCError (RPC_DESERIALIZATION_ERROR, " TX decode failed" );
908+ throw JSONRPCError (RPC_DESERIALIZATION_ERROR, " TX decode failed. Make sure the tx has at least one input. " );
909909 }
910910 CTransactionRef tx (MakeTransactionRef (std::move (mtx)));
911911 const uint256& tx_hash = tx->GetHash ();
0 commit comments