-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Bugfix: getwork/getmemorypool: NULL pindexPrev across CreateNewBlock, in case it fails #1245
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
luke-jr
added a commit
to luke-jr/bitcoin
that referenced
this pull request
May 10, 2012
…for proof-of-work and merkletree, since those need to be provided later) This throws an exception from CreateNewBlock otherwise, which is not safe without bitcoin#1245!
Member
Author
|
Eligius has been running this from block 179513 (56 blocks found) and EclipseMC from 180573 (11 blocks), totalling 67 valid blocks with no problems found. |
luke-jr
added a commit
to luke-jr/bitcoin
that referenced
this pull request
May 27, 2012
…for proof-of-work and merkletree, since those need to be provided later) This throws an exception from CreateNewBlock otherwise, which is not safe without bitcoin#1245!
Contributor
|
ACK |
suprnurd
pushed a commit
to chaincoin-legacy/chaincoin
that referenced
this pull request
Dec 5, 2017
lateminer
pushed a commit
to lateminer/bitcoin
that referenced
this pull request
Jan 22, 2019
Use accessor methods for Value() and Set() where appropriate.
lateminer
pushed a commit
to lateminer/bitcoin
that referenced
this pull request
May 6, 2020
3893739 [RPC] Fix getstakingstatus removing compile-time conditional (random-zebra) 9362e88 [Wallet][Cleanup][GUI] minor updates to staking status (random-zebra) 968d861 [Wallet] CStakerStatus: save a pointer to the tip instead of the hash (random-zebra) bb2a987 [GUI] Refactor updateStakingStatus and set it to inactive after locking (random-zebra) d2aebc5 [Trivial] Fix lastHashTime type in miner (random-zebra) b8ed76f [RPC] Add CStakerStatus data to getstakingstatus (random-zebra) d2d5f08 [PoS] Lock cs_main when getting chainActive data in miner (random-zebra) dbc46d8 [Cleanup] Remove unused variables in miner (random-zebra) 01173e9 [Core][PoS] Replace mapHashedBlocks and nLastCoinStakeSearchInterval (random-zebra) 6b2b813 [Cleanup][Wallet] Remove unused nSearchInterval field in CreateCoinStake (random-zebra) Pull request description: This PR cleans up the miner code and streamlines the logic used by the client (both in the RPC and in the GUI) to determine whether the wallet is staking or not. Currently it relies on a collection of variables (`mapHashedBlocks`, `nLastCoinStakeInterval`, `nSearchInterval`, etc...) updated in kernel. These are here replaced with a new class `CStakerStatus`, updated in `CreateCoinStake` (thus directly in wallet), and an instance of `CStakerStatus` is introduced as member of CWallet. This class keeps two variables, `timeLastStakeAttempt ` and `tipLastStakeAttempt`, containing respectively the time of last stake attempt and a pointer to the index of the block upon which last stake attempt was made. The Staking Status is Active whenever timeLastStakeAttempt is less than 30 seconds in the past. This PR also expands the output of `getstakingstatus` rpc call adding: - `staking_enabled` to tell whether or not staking has been disabled via conf file / startup flag - `hashLastStakeAttempt` and `timeLastStakeAttempt` values - `heightLastStakeAttempt` (the height of the block with hash `hashLastStakeAttempt`) - `tiptime` (the time of the chaintip block) to compare with `timeLastStakeAttempt`. This field replaces `valid_time` which is unnecessary now). and fixes `enoughcoins` with proper staking balance. ACKs for top commit: furszy: Pretty nice cleanup 👌 , ACK 3893739 Fuzzbawls: ACK 3893739 Tree-SHA512: f145650f59d2799641e64359c2656f0fd47397ab88893f4c179fa47b57ff5f166929b2af35741124a8a937431b072392f36b4ce50cce564a55df52a78aa9af0e
lateminer
pushed a commit
to lateminer/bitcoin
that referenced
this pull request
May 6, 2020
7a8d755 [Tests] Remove '-staking' from extra-args (random-zebra) 72d5a31 [Tests] Fix/Update mining_pos_coldstaking test (random-zebra) 5ffa6b5 [Trivial] Rename mintablecoins --> stakeablecoins (random-zebra) e781cd0 [Cleanup] zPIV Don't validate Accumulator Checkpoints anymore (random-zebra) 5b192e0 [Tests][Bug] Fix staking status in generate_pos() (random-zebra) Pull request description: This is based on top of bitcoin#1276 and bitcoin#1277 which should be reviewed before. `generate_pos` framework function relies on the output of `getstakingstatus` RPC which was recently changed. Since bitcoin#1245, "validtime" is not returned anymore (nor it was ever really needed here). Only things that we need in `generate_pos` are "walletunlocked" and "mintablecoins" (renamed "stakeablecoins"). "enoughcoins" is going to be removed in bitcoin#1277 , and "haveconnections" is not required on regtest. This also updates coldstaking test. ACKs for top commit: Fuzzbawls: ACK 7a8d755 furszy: ACK 7a8d755 Tree-SHA512: 0f45d8b3880d8d88258861fc85c04e0c62a834cede8991e1370afcaef05a2fb714a4441e201d0bdfd89251628e92aa51496182b8088917a8f3a9b740a21272f6
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Without this, the following bugs are possible: