Basic stuff needed to start merging.

This commit is contained in:
JoelKatz
2013-04-22 12:54:17 -07:00
parent eb6cc06c35
commit 4c480419e9
7 changed files with 16 additions and 6 deletions

View File

@@ -787,7 +787,13 @@ LedgerAcquire::pointer LedgerAcquireMaster::findCreate(const uint256& hash)
ptr->setTimer(); // Cannot call in constructor
}
else
{
Ledger::pointer ledger = ptr->getLedger();
ledger->setClosed();
ledger->setImmutable();
theApp->getLedgerMaster().storeLedger(ledger);
cLog(lsDEBUG) << "Acquiring ledger we already have: " << hash;
}
return ptr;
}

View File

@@ -265,7 +265,7 @@ bool LedgerMaster::acquireMissingLedger(Ledger::ref origLedger, const uint256& l
{
typedef std::pair<uint32, uint256> u_pair;
std::vector<u_pair> vec = origLedger->getLedgerHashes();
BOOST_REVERSE_FOREACH(const u_pair& it, vec)
BOOST_FOREACH(const u_pair& it, vec)
{
if ((fetchCount < fetchMax) && (it.first < ledgerSeq) &&
!mCompleteLedgers.hasValue(it.first) && !theApp->getMasterLedgerAcquire().find(it.second))

View File

@@ -571,6 +571,4 @@ std::ostream& operator<<(std::ostream& out, const SHAMapMissingNode& mn)
return out;
}
// vim:ts=4

View File

@@ -232,7 +232,7 @@ template<typename c_Key, typename c_Data> bool TaggedCache<c_Key, c_Data>::del(c
if (!valid || entry.isExpired())
mCache.erase(cit);
return true;
return ret;
}
template<typename c_Key, typename c_Data>

View File

@@ -82,7 +82,7 @@ void TFInit()
<< SOElement(sfReferenceFeeUnits, SOE_REQUIRED)
<< SOElement(sfReserveBase, SOE_REQUIRED)
<< SOElement(sfReserveIncrement, SOE_REQUIRED)
;
;
}
TransactionFormat* TransactionFormat::getTxnFormat(TransactionType t)

View File

@@ -77,6 +77,8 @@ bool ValidationCollection::addValidation(SerializedValidation::ref val, const st
it->second = val;
condWrite();
}
else
isCurrenty = false;
}
}
@@ -200,7 +202,7 @@ int ValidationCollection::getLoadRatio(bool overLoaded)
std::list<SerializedValidation::pointer> ValidationCollection::getCurrentTrustedValidations()
{
uint32 cutoff = theApp->getOPs().getNetworkTimeNC() - LEDGER_VAL_INTERVAL;
uint32 cutoff = theApp->getOPs().getNetworkTimeNC() - LEDGER_VAL_INTERVAL;
std::list<SerializedValidation::pointer> ret;

View File

@@ -119,6 +119,8 @@ message TMStatusChange {
optional bytes ledgerHash = 4;
optional bytes ledgerHashPrevious = 5;
optional uint64 networkTime = 6;
optional uint32 firstSeq = 7;
optional uint32 lastSeq = 8;
}
@@ -222,6 +224,7 @@ message TMIndexedObject
optional bytes nodeID = 2;
optional bytes index = 3;
optional bytes data = 4;
optional uint32 ledgerSeq = 5;
}
message TMGetObjectByHash
@@ -233,6 +236,7 @@ message TMGetObjectByHash
otTRANSACTION_NODE = 3;
otSTATE_NODE = 4;
otCAS_OBJECT = 5;
otFETCH_PACK = 6;
}
required ObjectType type = 1;