Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: Jet Cash on February 18, 2016, 05:33:44 PM



Title: Forking Q3 - what happens if I find a bad transaction?
Post by: Jet Cash on February 18, 2016, 05:33:44 PM
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?


Title: Re: Forking Q3 - what happens if I find a bad transaction?
Post by: calkob on February 18, 2016, 05:38:32 PM
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  ;D  All core nodes will agree on what is the next block because it meets all the parameters.....


Title: Re: Forking Q3 - what happens if I find a bad transaction?
Post by: DannyHamilton on February 18, 2016, 07:11:13 PM
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.


Title: Re: Forking Q3 - what happens if I find a bad transaction?
Post by: Jet Cash on February 19, 2016, 03:46:33 AM
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?


Title: Re: Forking Q3 - what happens if I find a bad transaction?
Post by: DannyHamilton on February 19, 2016, 04:22:52 AM
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.


Title: Re: Forking Q3 - what happens if I find a bad transaction?
Post by: VeritasSapere on February 19, 2016, 04:43:05 AM
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/ (https://bitcoinclassic.com/)
http://www.bitcoinunlimited.info/ (http://www.bitcoinunlimited.info/)