Bitcoin Forum
May 06, 2024, 01:30:11 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to invalidate a block  (Read 165 times)
decryptit (OP)
Member
**
Offline Offline

Activity: 100
Merit: 15


View Profile
October 03, 2022, 05:28:06 AM
 #1

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.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715002211
Hero Member
*
Offline Offline

Posts: 1715002211

View Profile Personal Message (Offline)

Ignore
1715002211
Reply with quote  #2

1715002211
Report to moderator
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6581


Just writing some code


View Profile WWW
October 03, 2022, 05:31:52 AM
Merited by LoyceV (4)
 #2

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.

decryptit (OP)
Member
**
Offline Offline

Activity: 100
Merit: 15


View Profile
October 06, 2022, 10:08:11 PM
 #3

ah ok. Thank you.
decryptit (OP)
Member
**
Offline Offline

Activity: 100
Merit: 15


View Profile
October 06, 2022, 10:18:48 PM
 #4

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?
NotATether
Legendary
*
Online Online

Activity: 1596
Merit: 6728


bitcoincleanup.com / bitmixlist.org


View Profile WWW
October 07, 2022, 12:12:13 AM
 #5

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?

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
nc50lc
Legendary
*
Offline Offline

Activity: 2408
Merit: 5588


Self-proclaimed Genius


View Profile
October 07, 2022, 07:07:22 AM
Merited by ABCbits (1)
 #6

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.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
decryptit (OP)
Member
**
Offline Offline

Activity: 100
Merit: 15


View Profile
October 18, 2022, 12:26:57 AM
 #7

ah ok. Thanks!
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!