bitcoin/bitcoin — pull request #5048 by cozz (2014-10-05 23:45:42+00:00)
Title: txoutsbyaddress index

Adds new rpc call "gettxoutsbyaddress" as requested in #4007.
Disabled by default, enabled with -txoutsbyaddressindex.

The index is built from the normal utxo on first use, reindex is not required.
For the GUI there is progress shown, on bitcoind you just need to be patient.

The qa-test includes a simple reorganization.
I tested all 4 code parts in main.cpp by commenting them out and check if the qa-test fails at the expected line.
I had to modify the rpc call for this test, as normally wrong outputs in the address index are not exposed to the user, because the rpc call relies on the normal GetCoins call.
The rest of the code has been tested in random ad-hoc testing.
I only tested linux on my machine.

Its all in 1 commit for laziness reasons, but if splitting in multiple commits would help reviewing, I could do that.

![txoutsbyaddress](https://cloud.githubusercontent.com/assets/2814559/4520346/bac8f3e0-4ce8-11e4-9f31-be597965dc77.png)

![txoutsbyaddress3](https://cloud.githubusercontent.com/assets/2814559/4520369/6b9e3c52-4ce9-11e4-81e0-e541caeedf62.png)