Site icon farm-bitcoin.com

json rpc – What is the role of “Invalidateblock” RPC command and are there any possible transaction validation issues with regard to this?

json rpc – What is the role of “Invalidateblock” RPC command and are there any possible transaction validation issues with regard to this?


I have been testing various RPC commands on bitcoin.

The “RPC API Reference” page well demonstrates almost all of the commands.

But by reading the source code (bitcoin v27.0), I noticed that some of the commands are not documented.

Most notable ones are “invalidateblock” and “reconsiderblock”. (What these commands do seems pretty obvious: making a block invalid by force and verifying a block again along with all the transactions in it.)

I tested those two commands on my bitcoin node and the behavior was as I expected.

Q1 => Why do these commands even exist?

Q2 => Also, I have noticed that MemPoolAccept::ConsensusScriptChecks function in src/validation.cpp plays a role in the “invalidateblock” process. It seems some past transactions might be marked as invalid if the script verification flags are different between the block that is being invalidated, and the most recent block. Is this a possible scenario and what happens in such occasions?



Source link

Exit mobile version