Skip to content

Conversation

@gmaxwell
Copy link
Contributor

When the internal miner is enabled at the start of a new node, there
is an near instant assert in TestBlockValidity because its attempting
to mine a block before the top checkpoint.

Also avoids a data race around vNodes.

When the internal miner is enabled at the start of a new node, there
 is an near instant assert in TestBlockValidity because its attempting
 to mine a block before the top checkpoint.

Also avoids a data race around vNodes.
@gmaxwell
Copy link
Contributor Author

This was reported on IRC by smccully; either of the two internal checks fix my reproduction of his problem.

An implication of this is that it makes it harder to intentionally fork testnet-- due to requiring getting it past IsInitialBlockDownload, which may be undesirable. (Though you should be able to syncup then invalidate block and mine ahead).

@laanwj laanwj added the Bug label Apr 29, 2015
@laanwj
Copy link
Member

laanwj commented Apr 29, 2015

This may be solved by Bugfix: Fix testnet-in-a-box use case #5987 as well (or at least overlaps in scope).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reproduced the issue to verify: the underlying problem appears to be that the std::runtime_exception raised by CreateNewBlock in case TestBlockValidity fails is not caught by the internal miner. The other uses of this function in RPC are protected.

terminate called after throwing an instance of 'std::runtime_error'
  what():  CreateNewBlock() : TestBlockValidity failed

Adding an extra check here at the beginning is redundant - you'd add a check to avoid raising an exception later in the same funcion :) better to change the calling code in BitcoinMiner to catch and report this exception.

@laanwj
Copy link
Member

laanwj commented May 11, 2015

See here: laanwj@89388eb

I've tested it with and without the change to BitcoinMiner, it catches the same problem.

@gmaxwell
Copy link
Contributor Author

That looks good to me.

@laanwj
Copy link
Member

laanwj commented May 12, 2015

Ok, submitted that as pull, closing in favor of #6123

@laanwj laanwj closed this May 12, 2015
@ghost
Copy link

ghost commented May 18, 2015

Great. Adding a reference to #5742 for tracking purposes.

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants