From 488f0474a89f4dd509883a97622cb1d857823dcb Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Wed, 26 Jun 2024 18:25:19 +0000 Subject: [PATCH] rpc: extend error-on-failure to GetSpentIndex --- src/rpc/index_util.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/rpc/index_util.cpp b/src/rpc/index_util.cpp index fd04ef0231..d4693cfe3a 100644 --- a/src/rpc/index_util.cpp +++ b/src/rpc/index_util.cpp @@ -14,10 +14,10 @@ bool GetAddressIndex(const uint160& addressHash, const AddressType type, const int32_t start, const int32_t end) { if (!fAddressIndex) - return error("address index not enabled"); + return error("Address index not enabled"); if (!pblocktree->ReadAddressIndex(addressHash, type, addressIndex, start, end)) - return error("unable to get txids for address"); + return error("Unable to get txids for address"); return true; } @@ -26,10 +26,10 @@ bool GetAddressUnspentIndex(const uint160& addressHash, const AddressType type, std::vector>& unspentOutputs) { if (!fAddressIndex) - return error("address index not enabled"); + return error("Address index not enabled"); if (!pblocktree->ReadAddressUnspentIndex(addressHash, type, unspentOutputs)) - return error("unable to get txids for address"); + return error("Unable to get txids for address"); return true; } @@ -37,13 +37,13 @@ bool GetAddressUnspentIndex(const uint160& addressHash, const AddressType type, bool GetSpentIndex(const CTxMemPool& mempool, const CSpentIndexKey& key, CSpentIndexValue& value) { if (!fSpentIndex) - return false; + return error("Spent index not enabled"); if (mempool.getSpentIndex(key, value)) return true; if (!pblocktree->ReadSpentIndex(key, value)) - return false; + return error("Unable to get spend information"); return true; }