bitcoin/bitcoin — pull request #3652 by jmcorgan (2014-02-11 19:40:40+00:00)
Title: Adds transaction index by address (updates #2802 to current master)

This branch updates the original transaction index by address patch by sipa in #2802 to work with the current master.

To get here, successive portions of the master branch were merged into the addrindex branch, resolving merge conflicts along the way. There was no need to change any of sipa's original code, other than to accommodate things like splitting out bitcoin-cli or other code reorganizations. This did take a lot of merges; in retrospect it might have been faster to just re-implement the changes starting with the current master. Nonetheless, doing it this way preserves all the history (and blame) and allows backtracking along the branch to see what fixups were needed.

I've tested with with txindex=1 and addrindex=1 in bitcoin.conf (using -reindex on cli), and am able to make queries with bitcoin-cli:

```
./bitcoin-cli searchrawtransactions 1KwDYMJMS4xq3ZEWYfdBRwYG2fHwhZsipa
```
(output suppressed)

In the original pull request, there was some debate about whether the reference client should include this capability, for fear that some would come to rely on it; I don't see the concern and in fact it will allow me personally to implement some lite wallet functionality I've been wanting to pursue.

Also, it may be useful in helping deal with the current TX malleability issues by helping to identify actual transactions to/from addresses instead of just by txid.