forked from fluffyfunction/BitcoinPoW
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial hard fork - eliminate mining pools - sign loop
- Loading branch information
1 parent
6ee27e7
commit 0480b1f
Showing
12 changed files
with
296 additions
and
41 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
0480b1f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code includes two functions to determine the block type based on the nNonce value.
bool IsProofOfWork() const
{
return nNonce != 0xFEEDBEEF;
return !IsProofOfStake();
}
bool IsProofOfStake() const
{
return nNonce == 0xFEEDBEEF;
return (nNonce == 0xFEEDBEEF) || (nNonce == 0xFEEDBEE1);
}
std::string ToString() const;
Function explanations:
IsProofOfWork():
Checks if nNonce is not equal to 0xFEEDBEEF.
I Think There's a mistake as it returns after the first condition, ignoring the second return !IsProofOfStake();.
IsProofOfStake():
Checks if nNonce equals 0xFEEDBEEF.
Similar mistake as it returns after the first condition, ignoring the second return (nNonce == 0xFEEDBEEF) || (nNonce == 0xFEEDBEE1);.
bool IsProofOfWork() const
{
return nNonce != 0xFEEDBEEF;
}
bool IsProofOfStake() const
{
return (nNonce == 0xFEEDBEEF) || (nNonce == 0xFEEDBEE1);
}
the functions return correct values based on the specified conditions.
0480b1f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool IsProofOfWork() const
{
return nNonce != 0xFEEDBEEF && !IsProofOfStake();
}
bool IsProofOfStake() const
{
return nNonce == 0xFEEDBEEF || nNonce == 0xFEEDBEE1;
}
std::string ToString() const;
0480b1f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Cannot mine with 0 connections.
if (connman.GetNodeCount(ConnectionDirection::Both) == 0 ) {
UninterruptibleSleep(std::chrono::milliseconds{1000});
wallet.m_last_coin_stake_search_interval = 0;
s_hashes_per_second = 64 * s_coin_loop_prev_max_idx.load(std::memory_order_relaxed); // Adjusted calculation
s_cpu_loading = 0;
continue; // Skip to next iteration
}
// Other parts of the function...
void ThreadStakeMiner(wallet::CWallet& wallet, CConnman& connman, ChainstateManager& chainman, ...) {
// Previous code here...
}
0480b1f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTCW eliminate mining pools, Straight Solo, No Place For Mining Pools Here
Great Job Dev