diff --git a/src/LedgerProposal.cpp b/src/LedgerProposal.cpp index 4cc9a52ef..680c6a2c6 100644 --- a/src/LedgerProposal.cpp +++ b/src/LedgerProposal.cpp @@ -25,7 +25,7 @@ LedgerProposal::LedgerProposal(const RippleAddress& naSeed, const uint256& prevL mPreviousLedger(prevLgr), mCurrentHash(position), mCloseTime(closeTime), mProposeSeq(0), mPublicKey(RippleAddress::createNodePublic(naSeed)), mPrivateKey(RippleAddress::createNodePrivate(naSeed)) -{ +{ // OPTIMIZEME: This is expensive. We create both the public and private keys separately each time mPeerID = mPublicKey.getNodeID(); mTime = boost::posix_time::second_clock::universal_time(); } diff --git a/src/Peer.cpp b/src/Peer.cpp index 9c5664ed3..3b6470afe 100644 --- a/src/Peer.cpp +++ b/src/Peer.cpp @@ -758,6 +758,9 @@ void Peer::recvValidation(ripple::TMValidation& packet) return; } +// OPTIMIZEME: Should just defer validation checking to another thread +// checking the signature is expensive (but should do 'isNew' check here) + #ifndef TRUST_NETWORK try #endif diff --git a/src/SerializedValidation.cpp b/src/SerializedValidation.cpp index cc643b5cc..4c796b45a 100644 --- a/src/SerializedValidation.cpp +++ b/src/SerializedValidation.cpp @@ -43,7 +43,7 @@ SerializedValidation::SerializedValidation(const uint256& ledgerHash, uint32 sig setFieldH256(sfLedgerHash, ledgerHash); setFieldU32(sfSigningTime, signTime); if (naSeed.isValid()) - { + { // OPTIMIZEME: Should compute the node public key just once and pass it in RippleAddress np = RippleAddress::createNodePublic(naSeed); setFieldVL(sfSigningPubKey, np.getNodePublic()); mNodeID = np.getNodeID(); @@ -54,6 +54,7 @@ SerializedValidation::SerializedValidation(const uint256& ledgerHash, uint32 sig signingHash = getSigningHash(); std::vector signature; + // OPTIMIZEME: Should compute the node private key just once and pass it in RippleAddress::createNodePrivate(naSeed).signNodePrivate(signingHash, signature); setFieldVL(sfSignature, signature); // XXX Check if this can fail.