mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Mark some significant optimization opportuntities.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<unsigned char> 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.
|
||||
|
||||
Reference in New Issue
Block a user