Tie the SHAMap code to the HashedObject code in a much simpler way.

Write out dirty nodes when we accept a ledger.
This commit is contained in:
JoelKatz
2011-12-13 20:15:36 -08:00
parent 854df9d920
commit d1b2d12a04
3 changed files with 45 additions and 86 deletions

View File

@@ -12,6 +12,7 @@
#include "uint256.h"
#include "ScopedLock.h"
#include "Serializer.h"
#include "HashedObject.h"
class SHAMap;
@@ -291,13 +292,10 @@ public:
// return value: true=successfully completed, false=too different
bool compare(SHAMap::pointer otherMap, SHAMapDiff& differences, int maxCount);
int flushDirty(int maxNodes);
int flushDirty(int maxNodes, HashedObjectType t, uint32 seq);
// overloads for backed maps
virtual bool fetchInnerNode(const uint256& hash, const SHAMapNode& id, std::vector<unsigned char>& rawNode);
virtual bool fetchLeafNode(const uint256& hash, const SHAMapNode& id, std::vector<unsigned char>& rawNode);
virtual bool writeInnerNode(const uint256& hash, const SHAMapNode& id, const std::vector<unsigned char>& rawNode);
virtual bool writeLeafNode(const uint256& hash, const SHAMapNode& id, const std::vector<unsigned char>& rawNode);
bool fetchNode(const uint256& hash, std::vector<unsigned char>& rawNode);
static bool TestSHAMap();
virtual void dump();