HomePhabricator

[Chronik] Add `SpentByWriter` and `SpentByReader`

Description

[Chronik] Add SpentByWriter and SpentByReader

Summary:
This is necessary if we want to add to each output of a tx which tx (and input) spent it. We need to index this, because a node by itself doesn't store which output has been stored by which input.

This is especially important for block explorers, to allow navigating to the tx that spent an output.

We do this by storing for each tx (which has any spent outputs) a list of "spent-by" entries. Each entry tells us which output of that tx has been spent, which tx_num spent it and which input of the spending tx spent the output.

Test Plan: ninja check-crates

Reviewers: Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

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

Details

Provenance
tobias_ruckAuthored on Apr 24 2023, 13:11
tobias_ruckPushed on Apr 24 2023, 13:36
Reviewer
Restricted Project
Differential Revision
D13756: [Chronik] Add `SpentByWriter` and `SpentByReader`
Parents
rABC3f9a4578d30a: [linter] Work around a shellcheck issue
Branches
Unknown
Tags
Unknown