<p>I have been testing various RPC commands on bitcoin.</p>
<p>The <a href="https://developer.bitcoin.org/reference/rpc/index.html" rel="nofollow noreferrer" title="RPC API Reference">&quot;RPC API Reference&quot;</a> page well demonstrates almost all of the commands.</p>
<p>But by reading the source code (bitcoin v27.0), I noticed that some of the commands are not documented.</p>
<p>Most notable ones are &quot;invalidateblock&quot; and &quot;reconsiderblock&quot;. (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.)</p>
<p>I tested those two commands on my bitcoin node and the behavior was as I expected.</p>
<p>Q1 =&gt; Why do these commands even exist?</p>
<p>Q2 =&gt; Also, I have noticed that <code>MemPoolAccept::ConsensusScriptChecks</code> function in <code>src/validation.cpp</code> plays a role in the &quot;invalidateblock&quot; 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?</p>

CC BY-SA 4.0
2024-09-12T19:24:01.080Z
Hey paranoid, the second question seems quite a bit different than the prior topic. Could you perhaps ask it as another topic? Could you please also edit the title to form a question that communicates the gist of your topic?
Murch
CC BY-SA 4.0
2024-09-13T07:38:33.867Z
It seems to me that https://bitcoin.stackexchange.com/search?q=Invalidateblock reveals many use cases for this function
RedGrittyBrick
<transactions><json-rpc><block><validation><invalidateblock>
What is the role of "Invalidateblock" RPC command and are there any possible transaction validation issues with regard to this?
paranoid
# What is the role of "Invalidateblock" RPC command and are there any possible transaction validation issues with regard to this?

(Asked by: username_0 on 2024-09-12)

I have been testing various RPC commands on bitcoin.

The ["RPC API Reference"](https://developer.bitcoin.org/reference/rpc/index.html "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?

**Tags:** transactions, json-rpc, block, validation, invalidateblock

> **Comments:**
> **username_1**: Hey username_0, the second question seems quite a bit different than the prior topic. Could you perhaps ask it as another topic? Could you please also edit the title to form a question that communicates the gist of your topic?  
> **username_2**: It seems to me that https://bitcoin.stackexchange.com/search?q=Invalidateblock reveals many use cases for this function  

---

## 0 answers

