mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Updates.
This commit is contained in:
@@ -386,14 +386,14 @@ int NetworkOPs::beginConsensus(Ledger::pointer closingLedger, bool isEarly)
|
||||
return mConsensus->startup();
|
||||
}
|
||||
|
||||
bool NetworkOPs::proposeLedger(uint32 closingSeq, uint32 proposeSeq, const uint256& proposeHash,
|
||||
bool NetworkOPs::proposeLedger(const uint256& prevLgr, uint32 proposeSeq, const uint256& proposeHash,
|
||||
const std::string& pubKey, const std::string& signature)
|
||||
{
|
||||
if (mMode != omFULL)
|
||||
return true;
|
||||
|
||||
LedgerProposal::pointer proposal =
|
||||
boost::make_shared<LedgerProposal>(closingSeq, proposeSeq, proposeHash, pubKey);
|
||||
boost::make_shared<LedgerProposal>(prevLgr, proposeSeq, proposeHash, pubKey);
|
||||
if (!proposal->checkSign(signature))
|
||||
{
|
||||
std::cerr << "Ledger proposal fails signature check" << std::endl;
|
||||
|
||||
11
src/Peer.cpp
11
src/Peer.cpp
@@ -612,15 +612,16 @@ void Peer::recvTransaction(newcoin::TMTransaction& packet)
|
||||
|
||||
void Peer::recvPropose(newcoin::TMProposeSet& packet)
|
||||
{
|
||||
if ((packet.currenttxhash().size() != 32) || (packet.nodepubkey().size() < 28) ||
|
||||
(packet.signature().size() < 56))
|
||||
if ((packet.currenttxhash().size() != 32) || (packet.prevclosedhash().size() != 32) ||
|
||||
(packet.nodepubkey().size() < 28) || (packet.signature().size() < 56))
|
||||
return;
|
||||
|
||||
uint32 closingSeq = packet.closingseq(), proposeSeq = packet.proposeseq();
|
||||
uint256 currentTxHash;
|
||||
uint32 proposeSeq = packet.proposeseq();
|
||||
uint256 currentTxHash, prevLgrHash;
|
||||
memcpy(currentTxHash.begin(), packet.currenttxhash().data(), 32);
|
||||
memcpy(prevLgrHash.begin(), packet.prevclosedhash().data(), 32);
|
||||
|
||||
if(theApp->getOPs().proposeLedger(closingSeq, proposeSeq, currentTxHash,
|
||||
if(theApp->getOPs().proposeLedger(prevLgrHash, proposeSeq, currentTxHash,
|
||||
packet.nodepubkey(), packet.signature()))
|
||||
{ // FIXME: Not all nodes will want proposals
|
||||
PackedMessage::pointer message = boost::make_shared<PackedMessage>(packet, newcoin::mtPROPOSE_LEDGER);
|
||||
|
||||
Reference in New Issue
Block a user