fix EstimateSize for gettxoutsetinfo

This commit is contained in:
Brannon King 2020-03-06 10:25:05 -07:00
parent 91cb187522
commit e5a5260bda

View file

@ -157,8 +157,8 @@ bool CCoinsViewDB::BatchWrite(const CCoinsMap &mapCoins, const uint256 &hashBloc
size_t CCoinsViewDB::EstimateSize() const
{
size_t ret = 0;
db << "SELECT COUNT(*) FROM unspent" >> ret;
return ret * 100;
db << "SELECT COUNT(*) FROM unspent ORDER BY txID, txN" >> ret; // force index use via order by
return ret * 770; // number chosen empirically
}
CBlockTreeDB::CBlockTreeDB(size_t nCacheSize, bool fMemory, bool fWipe)