Use the Coin abstraction to undo spends.
Summary:
This is useful during reorg. It is based on work by Pieter Wuille and a continuation of D342 .
It include special serialization and deserialization routines to ensure backward compatibility with existing on disk undo data.
Test Plan:
make check ../qa/pull-tester/rpc-test.py
Did a 5000 block deep reorg on testnet using invalidateblock/reconsiderblock
Reviewers: freetrader, kyuupichan, sickpig, awemany, #bitcoin_abc
Reviewed By: freetrader, #bitcoin_abc
Differential Revision: https://reviews.bitcoinabc.org/D368