mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Ledger consensus work.
This commit is contained in:
@@ -386,18 +386,36 @@ int NetworkOPs::beginConsensus(Ledger::pointer closingLedger)
|
||||
return mConsensus->startup();
|
||||
}
|
||||
|
||||
bool NetworkOPs::proposeLedger(uint32 closingSeq, uint32 proposeSeq,
|
||||
const uint256& prevHash, const uint256& proposeHash, const std::string& pubKey, const std::string& signature)
|
||||
bool NetworkOPs::proposeLedger(uint32 closingSeq, uint32 proposeSeq, const uint256& proposeHash,
|
||||
const std::string& pubKey, const std::string& signature)
|
||||
{
|
||||
uint256 nodeID = Serializer::getSHA512Half(pubKey);
|
||||
if (mMode != omFULL)
|
||||
return true;
|
||||
|
||||
LedgerProposal::pointer proposal =
|
||||
boost::make_shared<LedgerProposal>(closingSeq, proposeSeq, proposeHash, pubKey);
|
||||
if (!proposal->checkSign(signature))
|
||||
{
|
||||
std::cerr << "Ledger proposal fails signature check" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Is this node on our UNL?
|
||||
// WRITEME
|
||||
|
||||
// Are we currently closing?
|
||||
Ledger::pointer currentLedger = theApp->getMasterLedger().getCurrentLedger();
|
||||
|
||||
// Yes: Is it an update?
|
||||
// WRITEME
|
||||
if (!mConsensus)
|
||||
{
|
||||
if ((getNetworkTimeNC() + 2) >= currentLedger->getCloseTimeNC())
|
||||
setStateTimer(beginConsensus(currentLedger));
|
||||
if (!mConsensus) return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
return mConsensus->peerPosition(proposal);
|
||||
}
|
||||
|
||||
SHAMap::pointer NetworkOPs::getTXMap(const uint256& hash)
|
||||
{ // WRITEME
|
||||
return SHAMap::pointer();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user