Don't log 'ERROR: spent index not enabled'
This commit is contained in:
parent
7aaefab2d7
commit
d0e836a15e
|
@ -4,3 +4,9 @@ release-notes at release time)
|
|||
Notable changes
|
||||
===============
|
||||
|
||||
RPC changes
|
||||
-----------
|
||||
|
||||
- Fixed an issue where `ERROR: spent index not enabled` would be logged
|
||||
unnecessarily on nodes that have either insightexplorer or lightwalletd
|
||||
configuration options enabled.
|
||||
|
|
56
src/main.cpp
56
src/main.cpp
|
@ -2019,27 +2019,31 @@ bool AcceptToMemoryPool(
|
|||
bool GetTimestampIndex(unsigned int high, unsigned int low, bool fActiveOnly,
|
||||
std::vector<std::pair<uint256, unsigned int> > &hashes)
|
||||
{
|
||||
if (!fTimestampIndex)
|
||||
return error("Timestamp index not enabled");
|
||||
|
||||
if (!pblocktree->ReadTimestampIndex(high, low, fActiveOnly, hashes))
|
||||
return error("Unable to get hashes for timestamps");
|
||||
|
||||
if (!fTimestampIndex) {
|
||||
LogPrint("rpc", "Timestamp index not enabled");
|
||||
return false;
|
||||
}
|
||||
if (!pblocktree->ReadTimestampIndex(high, low, fActiveOnly, hashes)) {
|
||||
LogPrint("rpc", "Unable to get hashes for timestamps");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GetSpentIndex(CSpentIndexKey &key, CSpentIndexValue &value)
|
||||
{
|
||||
AssertLockHeld(cs_main);
|
||||
if (!fSpentIndex)
|
||||
return error("Spent index not enabled");
|
||||
|
||||
if (!fSpentIndex) {
|
||||
LogPrint("rpc", "Spent index not enabled");
|
||||
return false;
|
||||
}
|
||||
if (mempool.getSpentIndex(key, value))
|
||||
return true;
|
||||
|
||||
if (!pblocktree->ReadSpentIndex(key, value))
|
||||
return error("Unable to get spent index information");
|
||||
|
||||
if (!pblocktree->ReadSpentIndex(key, value)) {
|
||||
LogPrint("rpc", "Unable to get spent index information");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -2047,24 +2051,28 @@ bool GetAddressIndex(const uint160& addressHash, int type,
|
|||
std::vector<CAddressIndexDbEntry>& addressIndex,
|
||||
int start, int end)
|
||||
{
|
||||
if (!fAddressIndex)
|
||||
return error("address index not enabled");
|
||||
|
||||
if (!pblocktree->ReadAddressIndex(addressHash, type, addressIndex, start, end))
|
||||
return error("unable to get txids for address");
|
||||
|
||||
if (!fAddressIndex) {
|
||||
LogPrint("rpc", "address index not enabled");
|
||||
return false;
|
||||
}
|
||||
if (!pblocktree->ReadAddressIndex(addressHash, type, addressIndex, start, end)) {
|
||||
LogPrint("rpc", "unable to get txids for address");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GetAddressUnspent(const uint160& addressHash, int type,
|
||||
std::vector<CAddressUnspentDbEntry>& unspentOutputs)
|
||||
{
|
||||
if (!fAddressIndex)
|
||||
return error("address index not enabled");
|
||||
|
||||
if (!pblocktree->ReadAddressUnspentIndex(addressHash, type, unspentOutputs))
|
||||
return error("unable to get txids for address");
|
||||
|
||||
if (!fAddressIndex) {
|
||||
LogPrint("rpc", "address index not enabled");
|
||||
return false;
|
||||
}
|
||||
if (!pblocktree->ReadAddressUnspentIndex(addressHash, type, unspentOutputs)) {
|
||||
LogPrint("rpc", "unable to get txids for address");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue