Begin implementing continuous ledger close.

Pretty much all remaining changes should be to LedgerConsensus.cpp
This commit is contained in:
JoelKatz
2012-06-29 16:34:16 -07:00
parent 2cac0cb288
commit 3a77ef5c82
9 changed files with 47 additions and 68 deletions

View File

@@ -13,6 +13,7 @@ class LedgerProposal
protected:
uint256 mPreviousLedger, mCurrentHash;
uint64 mCloseTime;
uint32 mProposeSeq;
uint160 mPeerID;
@@ -25,13 +26,14 @@ public:
// proposal from peer
LedgerProposal(const uint256& prevLgr, uint32 proposeSeq, const uint256& propose,
const NewcoinAddress& naPeerPublic);
uint64 closeTime, const NewcoinAddress& naPeerPublic);
// our first proposal
LedgerProposal(const NewcoinAddress& privKey, const uint256& prevLedger, const uint256& position);
LedgerProposal(const NewcoinAddress& privKey, const uint256& prevLedger, const uint256& position,
uint64 closeTime);
// an unsigned proposal
LedgerProposal(const uint256& prevLedger, const uint256& position);
// an unsigned "dummy" proposal for nodes not validating
LedgerProposal(const uint256& prevLedger, const uint256& position, uint64 closeTime);
uint256 getSigningHash() const;
bool checkSign(const std::string& signature, const uint256& signingHash);
@@ -41,11 +43,12 @@ public:
const uint256& getCurrentHash() const { return mCurrentHash; }
const uint256& getPrevLedger() const { return mPreviousLedger; }
uint32 getProposeSeq() const { return mProposeSeq; }
uint64 getCloseTime() const { return mCloseTime; }
const NewcoinAddress& peekPublic() const { return mPublicKey; }
std::vector<unsigned char> getPubKey() const { return mPublicKey.getNodePublic(); }
std::vector<unsigned char> sign();
void changePosition(const uint256& newPosition);
void changePosition(const uint256& newPosition, uint64 newCloseTime);
};
#endif