bitcoin/bitcoin — pull request #1349 by gavinandresen (2012-05-18 02:28:04+00:00)
Title: ECDSA signature optimization and more DoS prevention 

These 6 commits:

1. Implement an ECDSA signature cache, which should cut the amount of CPU time spent verifying signatures in half (because transaction signatures are verified before going into the memory pool and then again when the block is accepted).

Please review that commit very carefully, since it is the very heart of transaction security.

2. Implement several "belt and suspenders" changes to prevent possible denial-of-service attacks involving sending orphan transactions (suggested by Sergio Demian Lerner) or transactions with lots of inputs.

Tested by:

- writing new unit tests, and stepping through the code in the debugger while running the new tests
- running the new code under valgrind for more than 24 hours on the main network