Merge branch 'master' of github.com:jedmccaleb/NewCoin

This commit is contained in:
jed
2012-06-18 19:43:57 -07:00
3 changed files with 15 additions and 8 deletions

View File

@@ -42,7 +42,6 @@ Ledger::Ledger(const uint256 &parentHash, const uint256 &transHash, const uint25
mTotCoins(totCoins), mCloseTime(timeStamp), mLedgerSeq(ledgerSeq), mLedgerInterval(LEDGER_INTERVAL),
mClosed(false), mValidHash(false), mAccepted(false), mImmutable(false)
{
assert(mParentHash.isNonZero());
updateHash();
}

View File

@@ -291,6 +291,12 @@ void NetworkOPs::checkState(const boost::system::error_code& result)
Log(lsINFO) << "Node count (" << peerList.size() << ") is sufficient.";
}
if (mConsensus)
{
setStateTimer(mConsensus->timerEntry());
return;
}
// Do we have sufficient validations for our last closed ledger? Or do sufficient nodes
// agree? And do we have no better ledger available?
// If so, we are either tracking or full.
@@ -344,11 +350,6 @@ void NetworkOPs::checkState(const boost::system::error_code& result)
}
}
if (mConsensus)
{
setStateTimer(mConsensus->timerEntry());
return;
}
if (switchLedgers)
{
@@ -538,6 +539,14 @@ void NetworkOPs::endConsensus()
void NetworkOPs::setMode(OperatingMode om)
{
if (mMode == om) return;
if (mMode == omFULL)
{
if (mConsensus)
{
mConsensus->abort();
mConsensus = boost::shared_ptr<LedgerConsensus>();
}
}
Log l((om < mMode) ? lsWARNING : lsINFO);
if (om == omDISCONNECTED) l << "STATE->Disonnected";
else if (om == omCONNECTED) l << "STATE->Connected";

View File

@@ -632,11 +632,10 @@ void Peer::recvTransaction(newcoin::TMTransaction& packet)
void Peer::recvPropose(newcoin::TMProposeSet& packet)
{
Log(lsINFO) << "Received proposal from peer";
if ((packet.currenttxhash().size() != 32) || (packet.nodepubkey().size() < 28) ||
(packet.signature().size() < 56))
{
Log(lsWARNING) << "Proposal is malformed";
Log(lsWARNING) << "Received proposal is malformed";
return;
}