namecoin / namecoin-legacy

Legacy client. New version here: https://github.com/namecoin/namecoin-core Note the release branch! - Official website:

Home Page:https://namecoin.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getrawtransaction for the genesis transaction does not work

erasmospunk opened this issue · comments

When I query the transaction from the genesis block
getrawtransaction 41c62dbd9068c89a449525e3cd5ac61b20ece28c3c38b3f35b2161f0e6d3cb0d
the following error appears
error: {"code":-5,"message":"No information available about transaction"}

I also experience this on Debian Jessie using the namecoind binary from OBS.

This is due to a historical bug: The genesis block's tx is not added to the txindex. It is also unspendable as a result. I raised discussion about this some time ago on the forum, but the consensus was to leave it as unspendable (which is also what Bitcoin does, BTW). It could be added to the txindex nevertheless, but I don't see a big advantage of doing so.

The advantage is consistency. When there is a block that contains a tx hash, it is expected that this tx could be fetched regardless if it can be spent.
Currently I am using Electrum server to index the Namecoin blockchain and had to create a workaround for this issue.
Maybe the new codebase will solve this?

Yes, I understand that. I had the same feeling when I stumbled over this issue (while experimenting with UTXO set construction half a year ago). If you provide a patch, I think we can merge it - but I also don't think it is worth fixing now.

I don't know if the new codebase fixes it - that depends on whether or not Bitcoin fixed the issue. (I know that the coinbase is still unspendable, but maybe they still add it to the tx index.) I guess that's the case, though.

Glad to hear about it. Yes, the Bitcoin solved this issue so it is reasonable to expect Namecoin will too.
So this is not needed I guess, closing...