Blockstream / esplora

Explorer for Bitcoin and Liquid
MIT License
991 stars 395 forks source link

BIP30 Duplicate TX displaying "wrong" height #186

Open pinheadmz opened 4 years ago

pinheadmz commented 4 years ago

This is just sort of amusing but in doing a bit of historical research on BIP30 and BIP34 I noticed one of the "duplicated" txids is displayed on the block explorer as being confirmed in block 91812:

https://blockstream.info/tx/d5d27987d2a3dfc724e359870c6644b40e497bdc0589a033220fe15429d88599

This is true, but that transaction was ALSO confirmed in block 91842.

The display is correct of course (and this is just semantics) but that utxo is considered by bitcoind to be confirmed in block 91842, the second time that transaction was confirmed:

$ echo $(( `bitcoin-cli getblockchaininfo \
| jq .blocks` - \
`bitcoin-cli gettxout d5d27987d2a3dfc724e359870c6644b40e497bdc0589a033220fe15429d88599 0 \
| jq .confirmations`))
91841
shesek commented 4 years ago

Hi, thanks for bringing this up to our attention! It definitely makes sense to handle the duplicate txids in the same manner that bitcoind does. I guess the only way to do this is to hardcode them as special cases? I believe this is what bitcoind did too. Will look into this.