@@ -645,7 +645,7 @@ static UniValue combinerawtransaction(const JSONRPCRequest& request)
645
645
646
646
for (unsigned int idx = 0 ; idx < txs.size (); idx++) {
647
647
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));
649
649
}
650
650
}
651
651
@@ -767,7 +767,7 @@ static UniValue signrawtransactionwithkey(const JSONRPCRequest& request)
767
767
768
768
CMutableTransaction mtx;
769
769
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. " );
771
771
}
772
772
773
773
FillableSigningProvider keystore;
@@ -831,10 +831,10 @@ static UniValue sendrawtransaction(const JSONRPCRequest& request)
831
831
UniValueType (), // VNUM or VSTR, checked inside AmountFromValue()
832
832
});
833
833
834
- // parse hex string from parameter
835
834
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
+ }
838
838
CTransactionRef tx (MakeTransactionRef (std::move (mtx)));
839
839
840
840
const CFeeRate max_raw_tx_fee_rate = request.params [1 ].isNull () ?
@@ -905,7 +905,7 @@ static UniValue testmempoolaccept(const JSONRPCRequest& request)
905
905
906
906
CMutableTransaction mtx;
907
907
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. " );
909
909
}
910
910
CTransactionRef tx (MakeTransactionRef (std::move (mtx)));
911
911
const uint256& tx_hash = tx->GetHash ();
0 commit comments