Avoid repeated lookups in mapOrphanTransactions and mapOrphanTransactionsByPrev

Rebased-From: 89d91f6
Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Fix crashing bug caused by orphan(s) with duplicate prevout.hash

Rebased-From: def2fdb
Rebased-By: Wladimir J. van der Laan
Limit CNode::mapAskFor

Tighten resource constraints on CNode.

Rebased-From: d4168c8
Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Avoid returning many "inv" orphans

Rebased-From: 540ac45
Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Remove timing-based signature cache unit test

Two changes:

First removes a unit test that fails in my development environment
(OSX, compiled -g3 with clang).

sipa says that's not terribly surprising; the CMutableTransaction change
makes signing a little more expensive but verification quicker. The unit
test timed sign+verify-uncached versus verify-cached-five-times.

He also says the test will be invalid when libsec256kp1 is integrated
(because validation is super-optimized over signing).

Conflicts:
	src/script.h (excluded from this commit because 0.9.3 lacks #4309)
	src/test/DoS_tests.cpp

Rebased-from: a90689ff9880cc76668d04beda5a5d97f2f4a76b
https://github.com/bitcoin/bitcoin/pull/4414
Stricter handling of orphan transactions

Prevent denial-of-service attacks by banning
peers that send us invalid orphan transactions
and only storing orphan transactions given to
us by a peer while the peer is connected.

Conflicts:
	src/main.cpp

Rebased-from: c74332c67806ed92e6e18de174671a7c30608780
https://github.com/bitcoin/bitcoin/pull/4885
Store fewer orphan tx by default, add -maxorphantx option

There is no reason to store thousands of orphan transactions;
normally an orphan's parents will either be broadcast or
mined reasonably quickly.

This pull drops the maximum number of orphans from 10,000 down
to 100, and adds a command-line option (-maxorphantx) that is
just like -maxorphanblocks to override the default.

Conflicts:
	src/init.cpp
	src/main.h

Rebased-from: aa3c697e90c02d5797a59a7bfb1ecac6fbd918cf
https://github.com/bitcoin/bitcoin/pull/4885