Pass the full node type to the sync filter.

This commit is contained in:
JoelKatz
2012-10-25 01:45:26 -07:00
parent 6c0916beb4
commit edfcdbe46b
3 changed files with 7 additions and 7 deletions

View File

@@ -237,7 +237,7 @@ public:
virtual ~SHAMapSyncFilter() { ; }
virtual void gotNode(const SHAMapNode& id, const uint256& nodeHash,
const std::vector<unsigned char>& nodeData, bool isLeaf)
const std::vector<unsigned char>& nodeData, SHAMapTreeNode::TNType type)
{ ; }
virtual bool haveNode(const SHAMapNode& id, const uint256& nodeHash, std::vector<unsigned char>& nodeData)

View File

@@ -247,7 +247,7 @@ bool SHAMap::addKnownNode(const SHAMapNode& node, const std::vector<unsigned cha
{
Serializer s;
newNode->addRaw(s, snfPREFIX);
filter->gotNode(node, hash, s.peekData(), newNode->isLeaf());
filter->gotNode(node, hash, s.peekData(), newNode->getType());
}
mTNByID[*newNode] = newNode;

View File

@@ -12,7 +12,7 @@ class ConsensusTransSetSF : public SHAMapSyncFilter
public:
ConsensusTransSetSF() { ; }
virtual void gotNode(const SHAMapNode& id, const uint256& nodeHash,
const std::vector<unsigned char>& nodeData, bool isLeaf)
const std::vector<unsigned char>& nodeData, SHAMapTreeNode::TNType)
{
// WRITEME: If 'isLeaf' is true, this is a transaction
theApp->getTempNodeCache().store(nodeHash, nodeData);
@@ -35,7 +35,7 @@ public:
{ ; }
virtual void gotNode(const SHAMapNode& id, const uint256& nodeHash,
const std::vector<unsigned char>& nodeData, bool isLeaf)
const std::vector<unsigned char>& nodeData, SHAMapTreeNode::TNType)
{
theApp->getHashedObjectStore().store(hotACCOUNT_NODE, mLedgerSeq, nodeData, nodeHash);
}
@@ -56,10 +56,10 @@ public:
{ ; }
virtual void gotNode(const SHAMapNode& id, const uint256& nodeHash,
const std::vector<unsigned char>& nodeData, bool isLeaf)
const std::vector<unsigned char>& nodeData, SHAMapTreeNode::TNType type)
{
theApp->getHashedObjectStore().store(isLeaf ? hotTRANSACTION : hotTRANSACTION_NODE, mLedgerSeq,
nodeData, nodeHash);
theApp->getHashedObjectStore().store((type == tnTRANSACTION_NM) ? hotTRANSACTION : hotTRANSACTION_NODE,
mLedgerSeq, nodeData, nodeHash);
}
virtual bool haveNode(const SHAMapNode& id, const uint256& nodeHash, std::vector<unsigned char>& nodeData)
{ // fetchNodeExternal already tried