Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: decryptit on October 03, 2022, 05:28:06 AM



Title: How to invalidate a block
Post by: decryptit on October 03, 2022, 05:28:06 AM
Hey guys so for educational purposes, how do I use Bitcoin Core to invalidate a block? And then how do I return to normal after? Thanks.


Title: Re: How to invalidate a block
Post by: achow101 on October 03, 2022, 05:31:52 AM
invalidateblock <blockhash> where <blockhash> is the hash of the block you wish to mark as invalid.

reconsiderblock <blockhash> where <blockhash> is the hash of the block and it's ancestors that you wish for the node to revalidate.


Title: Re: How to invalidate a block
Post by: decryptit on October 06, 2022, 10:08:11 PM
ah ok. Thank you.


Title: Re: How to invalidate a block
Post by: decryptit on October 06, 2022, 10:18:48 PM
invalidateblock <blockhash> where <blockhash> is the hash of the block you wish to mark as invalid.

reconsiderblock <blockhash> where <blockhash> is the hash of the block and it's ancestors that you wish for the node to revalidate.

So I just tried it. And I get a "Empty response". What does that mean?


Title: Re: How to invalidate a block
Post by: NotATether on October 07, 2022, 12:12:13 AM
invalidateblock <blockhash> where <blockhash> is the hash of the block you wish to mark as invalid.

reconsiderblock <blockhash> where <blockhash> is the hash of the block and it's ancestors that you wish for the node to revalidate.

So I just tried it. And I get a "Empty response". What does that mean?

Some RPC calls have no response because it wouldn't make any sense to return anything. Invalidateblock is one such example - you already have the block hash passed as a parameter, what more could be returned?


Title: Re: How to invalidate a block
Post by: nc50lc on October 07, 2022, 07:07:22 AM
So I just tried it. And I get a "Empty response". What does that mean?
That's the response if that command is executed successfully.
Otherwise, it'll return with "Block not found", "blockhash must be of length 64" or other errors.

You can immediately see that the block is invalidated in bitcoind with the lines InvalidChainFound: invalid block=n or in the logs (debug.log) file.


Title: Re: How to invalidate a block
Post by: decryptit on October 18, 2022, 12:26:57 AM
ah ok. Thanks!