Ledger consensus stuff.

This commit is contained in:
JoelKatz
2012-05-23 15:18:34 -07:00
parent fecf3aaac9
commit 9b9177f15e
3 changed files with 36 additions and 7 deletions

View File

@@ -87,6 +87,28 @@ bool TransactionAcquire::takeNodes(const std::list<SHAMapNode>& nodeIDs,
return true;
}
LedgerConsensus::LedgerConsensus(Ledger::pointer previousLedger)
: mState(lcsPRE_CLOSE), mPreviousLedger(previousLedger)
{
}
void LedgerConsensus::closeTime(Ledger::pointer& current)
{
if (mState != lcsPRE_CLOSE)
{
assert(false);
return;
}
CKey::pointer nodePrivKey = boost::make_shared<CKey>();
nodePrivKey->MakeNewKey(); // FIXME
current->updateHash();
uint256 txSet = current->getTransHash();
mOurPosition = boost::make_shared<LedgerProposal>(nodePrivKey, current->getParentHash(), txSet);
mComplete[txSet] = current->peekTransactionMap()->snapShot();
// WRITME: Broadcast an IHAVE for this set
}
void LedgerConsensus::abort()
{
}