-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Abort Block Generation #1
Comments
This change should also introduce states in
|
Merged
tabone
added a commit
that referenced
this issue
Nov 11, 2017
In this PR changes were implemented to enable a user to abort the generation of the Block being added in the Blockchain. As discussed in #1, this feature will be needed for when the blockchain-node is implemented, since when a new Block is received from another blockchain-node the Block generation needs to be restarted. In order to achieve this, the Block object was updated to now have the following states: * initializing: block is still working on generating the hash. * ready: block has been initialized. * aborted: block has been aborted. In addition to this, a new abort() function was introduced in the Block module, which as it name implies it will stop the initialization of the Block. Note that if this function is invoked when the Block is not in the initializing state, it will emit an error. With respect to the Blockchain object, the following two functions has been introduced: * abort(): Used to stop the current Block being generated. * resume(): Used to resume the Block generation. When the generation of the current Block is aborted, the Blockchain should: * Stop the Block generation process. * Re-include the Queued Data of the aborted Block.
Feature implemented in bb337d8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With the current implementation of the module, there is no way to abort the generation of a
Block
. Such functionality will be needed when implementingblockchain-node
module since when a newBlock
will be received theblockchain-node
should abort the currentBlock
generation and start on a new one.The text was updated successfully, but these errors were encountered: