diff --git a/src/core_write.cpp b/src/core_write.cpp index 8070e98db96..e479deedfe9 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -327,7 +327,7 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry, uint64_t minv; uint64_t maxv; const CTxOutWitness* ptxoutwit = tx.witness.vtxoutwit.size() <= i? NULL: &tx.witness.vtxoutwit[i]; - if (ptxoutwit && secp256k1_rangeproof_info(secp256k1_blind_context, &exp, &mantissa, &minv, &maxv, &ptxoutwit->vchRangeproof[0], ptxoutwit->vchRangeproof.size())) { + if (ptxoutwit && ptxoutwit->vchRangeproof.size() && secp256k1_rangeproof_info(secp256k1_blind_context, &exp, &mantissa, &minv, &maxv, &ptxoutwit->vchRangeproof[0], ptxoutwit->vchRangeproof.size())) { if (exp == -1) { out.pushKV("value", ValueFromAmount((CAmount)minv)); } else {