Bitcoin Forum
May 27, 2024, 08:49:03 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Forking Q3 - what happens if I find a bad transaction?  (Read 635 times)
Jet Cash (OP)
Legendary
*
Offline Offline

Activity: 2716
Merit: 2457


https://JetCash.com


View Profile WWW
February 18, 2016, 05:33:44 PM
 #1

I'm running the latest version of Bitcoin core, and I understand that this is good for the community because I am validating transactions. I'm not mining, so I'm not creating blocks. Now, what happens if I download a block, and I find that it contains an invalid transaction? Obviously, I can reject the block, but then what? At that point my blockchain has terminated. There doesn't seem to be a way for me to communicate the error with anybody. Do I just sit and wait for a miner to build another block based on the last valid one that I was given? What happens if I don't get anything based on that block?

Offgrid campers allow you to enjoy life and preserve your health and wealth.
Save old Cars - my project to save old cars from scrapage schemes, and to reduce the sale of new cars.
My new Bitcoin transfer address is - bc1q9gtz8e40en6glgxwk4eujuau2fk5wxrprs6fys
calkob
Hero Member
*****
Offline Offline

Activity: 1092
Merit: 520


View Profile
February 18, 2016, 05:38:32 PM
 #2

Your core node has set parameters built in you do not need to do anything,  If a block comes in that is not right it will just reject the block and so will all the other core nodes......... Easy  Grin  All core nodes will agree on what is the next block because it meets all the parameters.....
DannyHamilton
Legendary
*
Offline Offline

Activity: 3402
Merit: 4656



View Profile
February 18, 2016, 07:11:13 PM
 #3

Yes.  If a full node receives an invalid block from a peer, it should reject the block.  It shouldn't be added to the local copy of the blockchain, it shouldn't be relayed to any peers, and it shouldn't affect the current UTXO or current list of unconfirmed transactions.  The node should just continue to wait for a valid block, the same as if it hadn't received the invalid block.

If you never receive a valid block, then either the entire bitcoin experiment has failed and there is no longer anybody mining, or your peer is not well connected to the network and therefore is not hearing about valid blocks that are being broadcast and relayed.  In that case, you should investigate your connection problem and fix it.

Note that it is possible to receive blocks out of order.  In that case, you might receive a block that you can't determine if its valid or not until you receive other blocks that precede it.  Your node would need to get those earlier blocks from peers before deciding if the later block is valid or not.
Jet Cash (OP)
Legendary
*
Offline Offline

Activity: 2716
Merit: 2457


https://JetCash.com


View Profile WWW
February 19, 2016, 03:46:33 AM
 #4

But if it doesn't receive a valid block based on its last good ones, but continues to receive blocks based on the apparently bad block, is that the start of a hard fork? Can the node do anything at that stage, or must it update to be able to accept the new blocks?

Offgrid campers allow you to enjoy life and preserve your health and wealth.
Save old Cars - my project to save old cars from scrapage schemes, and to reduce the sale of new cars.
My new Bitcoin transfer address is - bc1q9gtz8e40en6glgxwk4eujuau2fk5wxrprs6fys
DannyHamilton
Legendary
*
Offline Offline

Activity: 3402
Merit: 4656



View Profile
February 19, 2016, 04:22:52 AM
 #5

But if it doesn't receive a valid block based on its last good ones, but continues to receive blocks based on the apparently bad block, is that the start of a hard fork? Can the node do anything at that stage, or must it update to be able to accept the new blocks?

In order to never receive a valid block based on its last good one, there would need to be 0 miners still using the old software, and 100% of all miners using software that think that this new block structure is "valid".

In that case, yes, a hard fork would have happened and unless you could find some miners and peers still running the old software you won't be able to send or receive bitcoins until you switch to the new software.
VeritasSapere
Hero Member
*****
Offline Offline

Activity: 546
Merit: 500



View Profile
February 19, 2016, 04:43:05 AM
 #6

But if it doesn't receive a valid block based on its last good ones, but continues to receive blocks based on the apparently bad block, is that the start of a hard fork? Can the node do anything at that stage, or must it update to be able to accept the new blocks?
In order to never receive a valid block based on its last good one, there would need to be 0 miners still using the old software, and 100% of all miners using software that think that this new block structure is "valid".

In that case, yes, a hard fork would have happened and unless you could find some miners and peers still running the old software you won't be able to send or receive bitcoins until you switch to the new software.
That is not entirely accurate, classic for instance will activate at seventy five percent of the hashrate. The client you run reflects your position on several issues regarding the future of Bitcoin. I would recommend running Bitcoin Unlimited since it will follow the longest chain automatically, or in other words, it will automatically follow the mining majority, so you will be on the longest chain regardless of what happens.

Regardless of what client you choose to use the node will deal with the situation without human intervention, based on the rules in its code, during the time of the fork. If you support scaling Bitcoin directly I would also recommend running Bitcoin Classic.

https://bitcoinclassic.com/
http://www.bitcoinunlimited.info/
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!