HomePhabricator

[Chronik] Index spent_by + add `spent_by` to `Tx` protobuf

Description

[Chronik] Index spent_by + add spent_by to Tx protobuf

Summary:
Add which outputs have been spent by which input using SpentByWriter for the DB and MempoolSpentBy for the mempool.

Add the spent_by field to TxOutput in the protobuf; this uses the OutPoint message, note that this points to an input.

Also add a OutputsSpent helper to query us the required data to tell which outputs have been spent by which tx.

Depends on D13768.

Test Plan: ninja && ninja ./test/functional/test_runner.py chronik_spent_by

Reviewers: Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D13759

Details

Provenance
tobias_ruckAuthored on Apr 24 2023, 13:46
tobias_ruckPushed on Apr 24 2023, 19:45
Reviewer
Restricted Project
Differential Revision
D13759: [Chronik] Index spent_by + add `spent_by` to `Tx` protobuf
Parents
rABCaacda0fe4516: [Chronik] Refactor `QueryTxs::tx_by_id`: remove Cow etc.
Branches
Unknown
Tags
Unknown