Builds on top of #4925
We do not need the return value of SetMerkleBranch(..) and we only call it with NON-NULL pointer. The only thing thats left what we need is to set hashBlock.
Do not store merkle branches inside the wallet. This means removing the check
that someone might have inserted an unconfirmed transaction in your wallet and
making it look like a confirmed one.
This means we don't need to keep the merkle branch in wallets (which takes up to
half a kilobyte per transactions), we don't need to validate it (which requires
a dozen sha256 operation per wallet transaction), remove the need to keep the
merkle tree in blocks (the case where it's needed is done separately in
CPartialMerkleTree), and simplifies the merkle root computation.
This also means not storing nIndex anymore. Do we want that?
I didnt realize nIndex is a member-variable. But we should pass the index to the function, instead of looping again and searching for it. I'll change it.
We currently don't need nIndex either, but it's information I'd like to keep around as it allows us to reconstruct the merkle path as long as the full blocks are available.
update: I added the code-block with nIndex back in now. I would prefer passing nIndex as parameter, but that can be done another time.
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4938_4333cc1c86c6164fd78621fb0d23e7e0eaabff79/ for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.