Also switch the (unused) verification code to low-s instead of even-s.

a81cd968 introduced a malleability breaker for signatures
(using an even value for S). In e0e14e43 this was changed to
the lower of two potential values, rather than the even one.
Only the signing code was changed though, the (for now unused)
verification code wasn't adapted.
Fix script test handling of empty scripts

Previously an empty script would evaluate to OP_0
Test CHECKMULTISIG with m == 0 and n == 0
script: add CScriptNum class

This class holds an int64_t and replaces the use of CBigInt for script
integrals.
script: switch to CScriptNum usage for scripts
script: switch outside users to CScriptNum
script: remove bignum dependency
script: add additional script tests
script: Add test for CScriptNum

Because this class replaces some usages of CBigNum, tests have been added to
verify that they function the same way. The only difference in their usage is
the handling of out-of-range numbers.

While operands are constrained to [-0x7FFFFFFF,0x7FFFFFFF], the results may
overflow. The overflowing result is technically unbounded, but in practice
it can be no bigger than the result of an operation on two operands. This
implementation limits them to the size of an int64.

CBigNum was unaware of this constraint, so it allowed for unbounded results,
which were then checked before use. CScriptNum asserts if an arithmetic
operation will overflow an int64_t, since scripts are not able to reach those
numbers anyway. Additionally, CScriptNum will throw an exception when
constructed from a vector containing more than 4 bytes This mimics the previous
CastToBigNum behavior.
Split up CheckBlock in a block and header version
Split AcceptBlockHeader from AcceptBlock.

Also modify some connection logic to deal with non-full blocks in the index.
Create (MANDATORY|STANDARD)_SCRIPT_VERIFY_FLAGS constants
Let tx (in)valid tests use any SCRIPT_VERIFY flag

Previously only P2SH could be set.
add DEFAULT_TRANSACTION_FEE constant in wallet

- as this is a shared Core/GUI setting, this makes it easier to keep them
  in sync (also no new includes are needed)
Remove NumBlocksOfPeers

Generally useless information. Only updates on connect time, not after
that. Peers can easily lie and the median filter is not effective in
preventing that.

In the past it was used for progress display in the GUI but
`CheckPoints::guessVerificationProgress` provides a better way that is now used.
It was too easy to mislead it. Peers do lie about it in practice, see issue #4065.

From the RPC, `getpeerinfo` gives the peer raw values, which are more
useful.
[Qt] fix Qt slot problem in receivecoinsdialog

- fixes error from debug.log:
  QMetaObject::connectSlotsByName: No matching signal for
  on_recentRequestsView_selectionChanged(QItemSelection,QItemSelection)
- small style fixes (e.g. alphabetical ordering if includes etc.)
- fixes #3992
ui: Check for !pixmap() before trying to export QR code

Adds null pointer checks as well as prevents the Save/Copy context
menu from appearing at all if no image is shown.

Fixes issue #4140
[Qt] fix ugly typo in bitcoin.cpp

Closes #4145.

Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Rebased-From: 1e4b083
Add rejection of non-null CHECKMULTISIG dummy values

This is a source of transaction mutability as the dummy value was
previously not checked and could be modified to something other than the
usual OP_0 value.
Do not trigger a DoS ban if SCRIPT_VERIFY_NULLDUMMY fails