From 8e1c49f0d70050e4d9b67b7697caac83b9945998 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Sat, 23 Jun 2012 22:28:49 -0700 Subject: [PATCH] Bugfixes. --- src/LedgerConsensus.cpp | 2 +- src/LedgerProposal.cpp | 1 - src/LedgerProposal.h | 12 ++++++------ src/NetworkOPs.cpp | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/LedgerConsensus.cpp b/src/LedgerConsensus.cpp index 89bdf7a48b..5baeff0d6a 100644 --- a/src/LedgerConsensus.cpp +++ b/src/LedgerConsensus.cpp @@ -766,7 +766,7 @@ void LedgerConsensus::accept(SHAMap::pointer set) { assert (theApp->getOPs().getNetworkTimeNC() > newLCL->getCloseTimeNC()); SerializedValidation::pointer v = boost::make_shared - (newLCLHash, newLCL->getCloseTimeNC(), mOurPosition->peekSeed(), mProposing); + (newLCLHash, newLCL->getCloseTimeNC(), mValSeed, mProposing); v->setTrusted(); theApp->getValidations().addValidation(v); std::vector validation = v->getSigned(); diff --git a/src/LedgerProposal.cpp b/src/LedgerProposal.cpp index 01cdd9607b..7d79bf0b6b 100644 --- a/src/LedgerProposal.cpp +++ b/src/LedgerProposal.cpp @@ -22,7 +22,6 @@ LedgerProposal::LedgerProposal(const uint256& pLgr, uint32 seq, const uint256& t LedgerProposal::LedgerProposal(const NewcoinAddress& naSeed, const uint256& prevLgr, const uint256& position) : mPreviousLedger(prevLgr), mCurrentHash(position), mProposeSeq(0) { - mSeed = naSeed; mPublicKey = NewcoinAddress::createNodePublic(naSeed); mPrivateKey = NewcoinAddress::createNodePrivate(naSeed); mPeerID = mPublicKey.getNodeID(); diff --git a/src/LedgerProposal.h b/src/LedgerProposal.h index 4dd32cd75d..35557920c5 100644 --- a/src/LedgerProposal.h +++ b/src/LedgerProposal.h @@ -16,9 +16,8 @@ protected: uint32 mProposeSeq; uint160 mPeerID; - NewcoinAddress mPublicKey; // Peer - NewcoinAddress mPrivateKey; // Our's - NewcoinAddress mSeed; // Our's + NewcoinAddress mPublicKey; + NewcoinAddress mPrivateKey; // If ours static const uint32 sProposeMagic = 0x50525000; // PRP @@ -27,10 +26,11 @@ public: typedef boost::shared_ptr pointer; // proposal from peer - LedgerProposal(const uint256& prevLgr, uint32 proposeSeq, const uint256& propose, const NewcoinAddress& naPeerPublic); + LedgerProposal(const uint256& prevLgr, uint32 proposeSeq, const uint256& propose, + const NewcoinAddress& naPeerPublic); // our first proposal - LedgerProposal(const NewcoinAddress& naSeed, const uint256& prevLedger, const uint256& position); + LedgerProposal(const NewcoinAddress& privKey, const uint256& prevLedger, const uint256& position); // an unsigned proposal LedgerProposal(const uint256& prevLedger, const uint256& position); @@ -43,7 +43,7 @@ public: const uint256& getCurrentHash() const { return mCurrentHash; } const uint256& getPrevLedger() const { return mPreviousLedger; } uint32 getProposeSeq() const { return mProposeSeq; } - const NewcoinAddress& peekSeed() const { return mSeed; } + const NewcoinAddress& peekPublic() const { return mPublicKey; } std::vector getPubKey() const { return mPublicKey.getNodePublic(); } std::vector sign(); diff --git a/src/NetworkOPs.cpp b/src/NetworkOPs.cpp index 786641ceb5..9280ea83d2 100644 --- a/src/NetworkOPs.cpp +++ b/src/NetworkOPs.cpp @@ -553,7 +553,7 @@ bool NetworkOPs::recvPropose(uint32 proposeSeq, const uint256& proposeHash, // Is this node on our UNL? // XXX Is this right? - if (!theApp->getUNL().nodeInUNL(proposal->peekSeed())) + if (!theApp->getUNL().nodeInUNL(proposal->peekPublic())) { Log(lsINFO) << "Untrusted proposal: " << naPeerPublic.humanNodePublic() << " " << proposal->getCurrentHash().GetHex();