Check the node store for transaction nodes with metadata

This commit is contained in:
David Schwartz
2014-03-07 10:36:39 -08:00
committed by Nik Bougalis
parent f42ae3af21
commit 60787be80c
3 changed files with 12 additions and 1 deletions

View File

@@ -33,6 +33,7 @@ SHAMap::SHAMap (SHAMapType t, FullBelowCache& fullBelowCache, uint32 seq,
, mLedgerSeq (0)
, mState (smsModifying)
, mType (t)
, mTXMap (false)
, m_missing_node_handler (missing_node_handler)
{
assert (mSeq != 0);
@@ -51,6 +52,7 @@ SHAMap::SHAMap (SHAMapType t, uint256 const& hash, FullBelowCache& fullBelowCach
, mLedgerSeq (0)
, mState (smsSynching)
, mType (t)
, mTXMap (false)
, m_missing_node_handler (missing_node_handler)
{
if (t == smtSTATE)
@@ -933,7 +935,7 @@ SHAMapTreeNode* SHAMap::getNodeAsync (
if (!ptr)
{
if (mType == smtTRANSACTION)
if (mTXMap)
{
// We don't store proposed transaction nodes in the node store
return nullptr;

View File

@@ -270,6 +270,13 @@ public:
treeNodeCache.setTargetAge (age);
}
void setTXMap ()
{
mTXMap = true;
}
typedef std::pair<uint256, SHAMapNode> TNIndex;
private:
static TaggedCache <uint256, SHAMapTreeNode> treeNodeCache;
@@ -321,6 +328,7 @@ private:
SHAMapTreeNode::pointer root;
SHAMapState mState;
SHAMapType mType;
bool mTXMap; // Map of transactions without metadata
MissingNodeHandler m_missing_node_handler;
};

View File

@@ -37,6 +37,7 @@ TransactionAcquire::TransactionAcquire (uint256 const& hash, clock_type& clock)
{
mMap = boost::make_shared<SHAMap> (smtTRANSACTION, hash,
std::ref (getApp().getFullBelowCache ()));
mMap->setTXMap ();
}
TransactionAcquire::~TransactionAcquire ()