Skip to content

Commit

Permalink
Updated UTXOCache memSize estimate to take into account latest changes
Browse files Browse the repository at this point in the history
It was underestimating the memory consumed by 32 bytes per shunspent
entry in the UTXOCache class. The new memory requirements are as of our
latest 1.9.0 changes where we just store the final value we plan to
write to DB in serialized form into the unordered map directly for
shunspents.
  • Loading branch information
cculianu committed Dec 20, 2022
1 parent 25375ee commit a5a53cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Storage.cpp
Expand Up @@ -1163,7 +1163,7 @@ class Storage::UTXOCache
ShunspentRmVec shunspentRms; ///< queued deletions, not yet deleted from DB

static constexpr size_t ShunspentTableNodeSize = sizeof(ShunspentTable::value_type) + HashLen + CompactTXO::minSize()
+ Util::qByteArrayPvtDataSize();
+ Util::qByteArrayPvtDataSize()*size_t{2u} + sizeof(int64_t); // not guaranteed accurate: doesn't take possible tokenData serialization into account
static constexpr size_t ShunspentRmVecNodeSize = sizeof(ShunspentRmVec::value_type) + HashLen + CompactTXO::minSize()
+ Util::qByteArrayPvtDataSize();

Expand Down

0 comments on commit a5a53cf

Please sign in to comment.