The current built-in node crashes with a `Couldn't find coin for input` error when a block containing txs gets reorged.
Here's what we think happened:
1. Transaction T got added to the mempool
2. Connected block A, mining T
3. Also connected block B, which also contained the tx
4. Avalanche selected block B to be finalized
5. Node disconnected block A (Chronik didn't receive this yet)
6. Node connected block B
7. Only now Chronik disconnects block A
8. Chronik adds T back to the mempool, however, FindCoins failed for the inputs.
It seems like the issue might be that the node already reorged the block and because we have a queue when processing tasks in the validation interface. Chronik disconnected the block later, which might have caused FindCoins to fail.
To fix this, we thread the spent_coins from the node to the validation interface queue, by adding spent_coins to TransactionAddedToMempool. This way Chronik is guaranteed to have the spent coins ready without having to query them from the node.
We use a `std::shared_ptr<const std::vector<Coin>>`, to ensure coins aren't freed and reused before they're used by the indexer. The interfaces take an owned shared_ptr, to make sure the memory isn't freed too early. In the (relatively far) future, we might move `spent_coins` into `CTransaction`, which would manage the memory for us.
List of changes:
1. Add (Rust) `CCoin` to the FFI pointing to C++'s `Coin`.
2. Change `bridge_tx` to take a vector of spent coins instead of `ChronikBridge` (and fix the bug).
3. Thread the spent coins to handle_tx_added_to_mempool and feed them to bridge_tx.