Skip to content

Commit d9f52ac

Browse files
Merge dashpay#6744: fix: remove useless but alarming log record about spent information
53a3415 fix: remove useless but alarming log record about spent information (Konstantin Akimov) Pull request description: ## Issue being fixed or feature implemented dashpay#6539 dashpay#6651 These log records are useless because RPC can be called remotely for non-existing tx: 2025-04-28T12:53:35Z ERROR: Unable to get spend information ## What was done? Just removed error log for it. ## How Has This Been Tested? Call RPC for non-existing transaction: getspentinfo '{"txid":"0437cd7f8525ceed2324359c2d0ba26006d92d856a9c20fa0241106ee5a597c9", "index":0}' ## Breaking Changes N/A Changes are only log-related ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone ACKs for top commit: PastaPastaPasta: utACK 53a3415 UdjinM6: utACK 53a3415 Tree-SHA512: c671d41c17efd18c82d16e83104a62b1f736f599e1fe78ef021a45c112010c8898f0d00837599208238773751fb9f308f9eae41991ec02d6f73564f96f34cf5f
2 parents e7ea396 + 53a3415 commit d9f52ac

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

src/rpc/index_util.cpp

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@ bool GetAddressIndex(CBlockTreeDB& block_tree_db, const uint160& addressHash, co
2626
AssertLockHeld(::cs_main);
2727
EnsureAddressIndexAvailable();
2828

29-
if (!block_tree_db.ReadAddressIndex(addressHash, type, addressIndex, start, end)) {
30-
return error("Unable to get txids for address");
31-
}
32-
33-
return true;
29+
return block_tree_db.ReadAddressIndex(addressHash, type, addressIndex, start, end);
3430
}
3531

3632
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
4036
EnsureAddressIndexAvailable();
4137

4238
if (!block_tree_db.ReadAddressUnspentIndex(addressHash, type, unspentOutputs))
43-
return error("Unable to get txids for address");
39+
return false;
4440

4541
if (height_sort) {
4642
std::sort(unspentOutputs.begin(), unspentOutputs.end(),
@@ -60,7 +56,7 @@ bool GetMempoolAddressDeltaIndex(const CTxMemPool& mempool,
6056
EnsureAddressIndexAvailable();
6157

6258
if (!mempool.getAddressIndex(addressDeltaIndex, addressDeltaEntries))
63-
return error("Unable to get address delta information");
59+
return false;
6460

6561
if (timestamp_sort) {
6662
std::sort(addressDeltaEntries.begin(), addressDeltaEntries.end(),
@@ -84,10 +80,7 @@ bool GetSpentIndex(CBlockTreeDB& block_tree_db, const CTxMemPool& mempool, const
8480
if (mempool.getSpentIndex(key, value))
8581
return true;
8682

87-
if (!block_tree_db.ReadSpentIndex(key, value))
88-
return error("Unable to get spend information");
89-
90-
return true;
83+
return block_tree_db.ReadSpentIndex(key, value);
9184
}
9285

9386
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
9992
throw JSONRPCError(RPC_INVALID_REQUEST, "Timestamp index is disabled. You should run Dash Core with -timestampindex (requires reindex)");
10093
}
10194

102-
if (!block_tree_db.ReadTimestampIndex(high, low, hashes))
103-
return error("Unable to get hashes for timestamps");
104-
105-
return true;
95+
return block_tree_db.ReadTimestampIndex(high, low, hashes);
10696
}

0 commit comments

Comments
 (0)