Too many bitcoins allowed in amount. (#2401)

Using magic number doesn't seem right. Could we factor this out, together with https://github.com/bitcoin/bitcoin/blob/master/src/bitcoinrpc.cpp#L96 ?
And what about BitcoinUnits::parse() as well ?
Added locks on the setpwalletRegistered functions in main.cpp and added an UnregisterAllWallets function.
Calling UnregisterAllWallets() instead of UnregisterWallet(pwalletMain) in init.cpp
Move core implementations to core.cpp
Merge pull request #2679 from vhf/patch-1

Too many bitcoins allowed as amount. (Issue #2401)
Truncate oversize 'tx' messages before relaying/storing.

Fixes a memory exhaustion attack on low-memory peers.
Merge pull request #2792 from sipa/coreimpl

Move core implementations to core.cpp
Merge pull request #2209 from CodeShark/WalletRegistrationLocks

Wallet registration locks in main.cpp + UnregisterAllWallet() function