blkchain icon indicating copy to clipboard operation
blkchain copied to clipboard

The field `txins.prevout_tx_id` can be NULL, and when it does, it breaks data consistency and. validity

Open drake-mer opened this issue 11 months ago • 1 comments

On a fully synchronized database

bitcoin=> select count(*) from txins where txins.prevout_tx_id is null;
 count  
--------
 900937
(1 row)

This is deeply concerning as it is not clear how it happens and it basically breaks the internal consistency of the database. It seems to happen preferentially for transactions having a huge number of inputs.

Trying to gather more infos if possible.

drake-mer avatar Feb 18 '25 18:02 drake-mer

@drake-mer might those be coinbase transactions?

https://github.com/blkchain/blkchain/blob/master/db/postgres.go#L1192C46-L1192C53

grisha avatar Feb 18 '25 20:02 grisha