namecoin / namecoin-legacy

Legacy client. New version here: https://github.com/namecoin/namecoin-core Note the release branch! - Official website:
https://namecoin.org
MIT License
448 stars 177 forks source link

Cache ECDSA signature verifications. #157

Closed domob1812 closed 10 years ago

domob1812 commented 10 years ago

Remember in each CTransaction instance when all signatures have been verified. This helps to speed up mining block creation, see also https://github.com/namecoin/namecoin/issues/154.

Please double-check the code to ensure that I didn't create a "coin stealing" vulnerability or something.

domob1812 commented 10 years ago

Updated the patch to do the caching in CTxIn. This seems more appropriate, since the signatures being checked are also on this level. Please test, review and merge if it works and looks good.

phelixbtc commented 10 years ago

In my profiling the time needed for VerifySignature as a percentage of ConnectInputs went down from 53% to 10%. The two measurements were under somewhat different circumstances, but it is pretty clear it is an improvement. The second version looks cleaner. Also I like your "inlining" :) Tested and ACK