From 53a3415d0714e3b72088301aedc76fd7192f57ae Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Tue, 8 Jul 2025 20:04:11 +0700 Subject: [PATCH] fix: remove useless but alarming log record about spent information These log records are useless because RPC can be called remotely: 2025-04-28T12:53:35Z ERROR: Unable to get spend information --- src/rpc/index_util.cpp | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/rpc/index_util.cpp b/src/rpc/index_util.cpp index e5e6960f311e..4291f1e773c8 100644 --- a/src/rpc/index_util.cpp +++ b/src/rpc/index_util.cpp @@ -26,11 +26,7 @@ bool GetAddressIndex(CBlockTreeDB& block_tree_db, const uint160& addressHash, co AssertLockHeld(::cs_main); EnsureAddressIndexAvailable(); - if (!block_tree_db.ReadAddressIndex(addressHash, type, addressIndex, start, end)) { - return error("Unable to get txids for address"); - } - - return true; + return block_tree_db.ReadAddressIndex(addressHash, type, addressIndex, start, end); } bool GetAddressUnspentIndex(CBlockTreeDB& block_tree_db, const uint160& addressHash, const AddressType type, @@ -40,7 +36,7 @@ bool GetAddressUnspentIndex(CBlockTreeDB& block_tree_db, const uint160& addressH EnsureAddressIndexAvailable(); if (!block_tree_db.ReadAddressUnspentIndex(addressHash, type, unspentOutputs)) - return error("Unable to get txids for address"); + return false; if (height_sort) { std::sort(unspentOutputs.begin(), unspentOutputs.end(), @@ -60,7 +56,7 @@ bool GetMempoolAddressDeltaIndex(const CTxMemPool& mempool, EnsureAddressIndexAvailable(); if (!mempool.getAddressIndex(addressDeltaIndex, addressDeltaEntries)) - return error("Unable to get address delta information"); + return false; if (timestamp_sort) { std::sort(addressDeltaEntries.begin(), addressDeltaEntries.end(), @@ -84,10 +80,7 @@ bool GetSpentIndex(CBlockTreeDB& block_tree_db, const CTxMemPool& mempool, const if (mempool.getSpentIndex(key, value)) return true; - if (!block_tree_db.ReadSpentIndex(key, value)) - return error("Unable to get spend information"); - - return true; + return block_tree_db.ReadSpentIndex(key, value); } bool GetTimestampIndex(CBlockTreeDB& block_tree_db, const uint32_t high, const uint32_t low, @@ -99,8 +92,5 @@ bool GetTimestampIndex(CBlockTreeDB& block_tree_db, const uint32_t high, const u throw JSONRPCError(RPC_INVALID_REQUEST, "Timestamp index is disabled. You should run Dash Core with -timestampindex (requires reindex)"); } - if (!block_tree_db.ReadTimestampIndex(high, low, hashes)) - return error("Unable to get hashes for timestamps"); - - return true; + return block_tree_db.ReadTimestampIndex(high, low, hashes); }