Is it possible to reindex specific blocks?

1

1

I came across a block on my Fullnode that throws an error when attempting the gettrawrtransaction RPC.

No such mempool or blockchain transaction. Use gettransaction for wallet transactions.

It's only one block so far that seems like it got corrupted or improperly indexed. If I change the block/transaction, the JSON-RPC call works. I have txindex=1 set in bitcoin.conf

My question is, can I tell bitcoind to reindex only that particular block 282455, or do I need to reindex the entire blockchain? If so, what's the fastest method? Setting a higher dbcache?

relik

Posted 2018-04-12T21:56:43.183

Reputation: 25

can you see your transaction in that block?Adam 2018-04-12T23:03:20.410

none of the transactions in that block work with getrawtransaction. They aren't my txs. I'm just trying to get the raw data on them, similar to a blockchain explorer.relik 2018-04-13T01:20:15.333

Can you give the txid of one of the transactions that fails for you?Nate Eldredge 2018-04-13T14:05:47.913

@NateEldredge e73da0c9a5548e62c73b5b297f33ab7605079bcdb00ca8c5afd56bfae835a88c or any tx in the 282455 blockrelik 2018-04-14T20:36:35.097

Answers

1

No, to the best of my knowledge there is no user-level command to reindex specific blocks. It's all or nothing.

If you want such a feature you'll have to write the code.

It seems to me kind of unlikely that the index would be wrong only for one specific block, so I would suggest looking for other explanations for the behavior you're seeing.

Nate Eldredge

Posted 2018-04-12T21:56:43.183

Reputation: 21 420