Merge pull request #57 from l0rdicon/master

Merge Protocol V2
Update setup.nsi

Version update
qt: add vout index to transaction id in transactions details dialog

Conflicts:
	src/qt/transactiondesc.cpp

Conflicts:
	src/qt/transactiondesc.cpp
	src/qt/transactiondesc.h
	src/qt/transactionrecord.cpp
	src/qt/transactiontablemodel.cpp
[Qt] Fix Transaction details shows wrong To:

Conflicts:
	src/qt/transactiondesc.cpp
AddToBlockIndex() is always called with locked cs_main
Replace non-threadsafe gmtime and setlocale

Make DateTimeStrFormat use boost::posix_time.

Also re-enable the util_DateTimeStrFormat tests, as they are no
longer platform specific.

Conflicts:
	src/test/util_tests.cpp
	src/util.cpp

Conflicts:
	src/rpcprotocol.cpp
	src/util.cpp
error if CheckProofOfStake() failed
Refactor: CTxMempool class to its own txmempool.{cpp,h}

Conflicts:
	src/init.cpp
	src/main.cpp
remove peercoin sync hacks
Make sure we always have a node to do IBD from

This introduces the concept of the 'sync node', which is the one we
asked for missing blocks. In case the sync node goes away, a new one
will be selected.

For now, the heuristic is very simple, but it can easily be extended
later to add better policies.

Conflicts:
	src/main.cpp
	src/net.cpp

Conflicts:
	src/main.cpp
Add bytessent, bytesrecv and syncnode to getpeerinfo

Conflicts:
	src/net.cpp
	src/net.h
	src/rpcnet.cpp
always show syncnode in getpeerinfo (fixes #2717)

Conflicts:
	src/rpcnet.cpp
Use pnode->nLastRecv as sync score directly

NodeSyncScore() should find the node which we recv data most recently, so put a negative sign to pnode->nLastRecv is indeed wrong.

Also change the return value type to int64_t.

Signed-off-by: Huang Le <4tarhl@gmail.com>
Add RPC command 'getstakedbyaddress' to find out how much an address has earned from staking.
Tidying up.
Add optional 'minconf' argument to 'getstakedbyaddress' RPC call.
Rebased the old dumpbootstrap branch.
Drop release times for CNode

It seems there were two mechanisms for assessing whether a CNode
was still in use: a refcount and a release timestamp. The latter
seems to have been there for a long time, as a safety mechanism.

However, this timer also keeps CNode objects alive for far longer
than necessary after disconnects, potentially opening up a DoS
window.

This commit removes the timestamp-based mechanism, and replaces
it with an assert(nRefCount >= 0), to verify that the refcounting
is indeed correctly working.

Conflicts:
	src/net.h
Bitcoin-Qt: update for BitcoinGUI::eventFilter()

- this allows us to use the progressbar and the label independently (if
  needed) and still prevents setStatusTip() to use them, if one of the 2
  is active

Conflicts:
	src/qt/bitcoingui.cpp
Bitcoin-Qt: emit numBlocksChanged for changed reindex or importing state

- this allows our progressbarlabel to correctly update, when we
  finish a reindex or import, but do not get new blocks from other sources

Conflicts:
	src/qt/clientmodel.cpp
	src/qt/clientmodel.h