Fix two bugs that could have been what Jed reported.

This commit is contained in:
JoelKatz
2012-06-29 22:41:14 -07:00
parent 6bbf7f58f0
commit b95dc249c0
2 changed files with 12 additions and 2 deletions

View File

@@ -8,6 +8,7 @@
#include "Application.h"
#include "Log.h"
#include "SHAMapSync.h"
#include "HashPrefixes.h"
#define LA_DEBUG
#define LEDGER_ACQUIRE_TIMEOUT 2
@@ -300,7 +301,12 @@ bool LedgerAcquire::takeBase(const std::string& data, Peer::pointer peer)
return false;
}
mHaveBase = true;
theApp->getHashedObjectStore().store(LEDGER, mLedger->getLedgerSeq(), strCopy(data), mHash);
Serializer s(data.size() + 4);
s.add32(sHP_Ledger);
s.addRaw(data);
theApp->getHashedObjectStore().store(LEDGER, mLedger->getLedgerSeq(), s.peekData(), mHash);
progress();
if (!mLedger->getTransHash()) mHaveTransactions = true;
if (!mLedger->getAccountHash()) mHaveState = true;

View File

@@ -234,7 +234,11 @@ bool SHAMap::addKnownNode(const SHAMapNode& node, const std::vector<unsigned cha
return false;
if (filter)
filter->gotNode(node, hash, rawNode, newNode->isLeaf());
{
Serializer s;
newNode->addRaw(s, STN_ARF_PREFIXED);
filter->gotNode(node, hash, s.peekData(), newNode->isLeaf());
}
mTNByID[*newNode] = newNode;
if (!newNode->isLeaf())