Switch CCoinsView and chainstate db from per-txid to per-txout
commit50830796889ecaa458871f1db878c255dd2554cb
authorPieter Wuille <pieter.wuille@gmail.com>
Tue, 25 Apr 2017 18:29:39 +0000 (25 11:29 -0700)
committerPieter Wuille <pieter.wuille@gmail.com>
Thu, 1 Jun 2017 19:59:38 +0000 (1 12:59 -0700)
tree32f3b55294a28d5328821b334a6b31be40d024d9
parent4ec0d9e794e3f338e1ebb8b644ae890d2c2da2ee
Switch CCoinsView and chainstate db from per-txid to per-txout

This patch makes several related changes:
* Changes the CCoinsView virtual methods (GetCoins, HaveCoins, ...)
  to be COutPoint/Coin-based rather than txid/CCoins-based.
* Changes the chainstate db to a new incompatible format that is also
  COutPoint/Coin based.
* Implements reconstruction code for hash_serialized_2.
* Adapts the coins_tests unit tests (thanks to Russell Yanofsky).

A side effect of the new CCoinsView model is that we can no longer
use the (unreliable) test for transaction outputs in the UTXO set
to determine whether we already have a particular transaction.
15 files changed:
src/coins.cpp
src/coins.h
src/init.cpp
src/net_processing.cpp
src/qt/transactiondesc.cpp
src/rest.cpp
src/rpc/blockchain.cpp
src/rpc/rawtransaction.cpp
src/test/coins_tests.cpp
src/test/test_bitcoin_fuzzy.cpp
src/txdb.cpp
src/txdb.h
src/txmempool.cpp
src/txmempool.h
src/validation.cpp