Deploy properly with Nokia Qt installer's Frameworks
In listaddressgroupings push down the IsMine check to run on each input.

This avoids a potential crash when trying to read the scrippubkeys on
transactions where the first input IsMine but some of the rest are not
when running listaddressgroupings.
Bitcoin-Qt: ensure all Windows scopes use win32 as identifier

- currently we sometimes use "windows" or "win32", but as per
  http://doc.qt.digia.com/qt/qmake-advanced-usage.html, windows seems to
  be not officially supported (only win32 is mentioned there)
Upgrading to 0.8: re-use blkNNNN.dat files.
changed CreateNewBlock to return a CBlockTemplate object, which includes per-tx fee and sigop count data
use fee/sigop data in BlockTemplate struct instead of (not always correctly) calculating it ourselves
Make IsCanonicalScript() check the hash type more thoroughly

0 and 128 were previously accepted as standard hash type.

Note that this function is not active in the current verification
code.
If the prio. will be enough after the next block don't force fees.

  If the user was really after the fastest possible confirmation times
they would be manually setting a fee. In cases where the wallet builds
a transaction with a priority that is too low to qualify as free until
the next block, go ahead without a fee.  Confirmation frequently takes
multiple blocks even when a minimum fee is provided.
OutputDebugStringF code cleanup

Initialize the OutputDebugStringF mutex and file pointer using
boost::call_once, to be thread-safe.
Make the return value of OutputDebugStringF really be the number of
characters written (*printf() semantics).
Declare the fReopenDebugLog flag volatile, since it is changed from
a signal handler.
And don't declare OutputDebugStringF() as inline.
Make DisconnectBlock fault-tolerant
Add checksums to undo data

This should be compatible with older code that didn't write checksums.
moved "index_in_template" to a separate variable to clarify what it is
New database check routine

-checklevel gets a new meaning:
0: verify blocks can be read from disk (like before)
1: verify (contextless) block validity (like before)
2: verify undo files can be read and have good checksums
3: verify coin database is consistent with the last few blocks
   (close to level 6 before)
4: verify all validity rules of the last few blocks

Level 3 is the new default, as it's reasonably fast. As level 3 and
4 are implemented using an in-memory rollback of the database, they
are limited to as many blocks as possible without exceeding the
limits set by -dbcache. The default of -dbcache=25 allows for some
150-200 blocks to be rolled back.

In case an error is found, the application quits with a message
instructing the user to restart with -reindex. Better instructions,
and automatic recovery (when possible) or automatic reindexing are
left as future work.
Make output of gettxout RPC more consistent

* Report "value" in BTC, rather than "amount" in satoshis
* Use ScriptPubKeyToJSON to report script data
Move VerifySignature to main
Add CScriptCheck: a closure representing a script check
Remove CheckSig_mode and move logic out of CheckInputs()
Parallelize script verification

* During block verification (when parallelism is requested), script
  check actions are stored instead of being executed immediately.
* After every processed transactions, its signature actions are
  pushed to a CScriptCheckQueue, which maintains a queue and some
  synchronization mechanism.
* Two or more threads (if enabled) start processing elements from
  this queue,
* When the block connection code is finished processing transactions,
  it joins the worker pool until the queue is empty.

As cs_main is held the entire time, and all verification must be
finished before the block continues processing, this does not reach
the best possible performance. It is a less drastic change than
some more advanced mechanisms (like doing verification out-of-band
entirely, and rolling back blocks when a failure is detected).

The -par=N flag controls the number of threads (1-16). 0 means auto,
and is the default.
Remove contention on signature cache during block validation

Since block validation happens in parallel, multiple threads may be
accessing the signature cache simultaneously. To prevent contention:
* Turn the signature cache lock into a shared mutex
* Make reading from the cache only acquire a shared lock
* Let block validations not store their results in the cache
Display tx nLockTime correctly when set to block #

Previously when a transaction was set to lock at a specific block the
calculation was reversed, returning a negative number. This broke the UI
and caused it to display %n in place of the actual number.

In addition the previous calculation would display "Open for 0 blocks"
when the block height was such that the next block created would
finalize the transaction. Inserted the word "more" and changed the
calculation so that the last message would be "Open for 1 more block" to
better match user expectations.