-
Notifications
You must be signed in to change notification settings - Fork 122
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
log: Adjust masternode staking output to fix issue #648 #1006
Changes from 3 commits
824a95c
3d2ca99
4bdd206
0b2fb14
9ba2dbc
36b39c2
1bb9436
88e4b01
93cc358
a23ce82
2a00b18
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -793,7 +793,7 @@ namespace pos { | |
{ | ||
if (shouldIgnoreMint(ctxState.subNode, blockHeight, creationHeight, subNodesBlockTime, chainparams)) | ||
break; | ||
LogPrint(BCLog::STAKING, "MakeStake: kernel found\n"); | ||
LogPrintf("MakeStake: kernel found\n"); | ||
|
||
found = true; | ||
break; | ||
|
@@ -818,7 +818,7 @@ namespace pos { | |
{ | ||
if (shouldIgnoreMint(ctxState.subNode, blockHeight, creationHeight, subNodesBlockTime, chainparams)) | ||
break; | ||
LogPrint(BCLog::STAKING, "MakeStake: kernel found\n"); | ||
LogPrintf("MakeStake: kernel found\n"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above. |
||
|
||
found = true; | ||
break; | ||
|
@@ -917,22 +917,22 @@ void ThreadStaker::operator()(std::vector<ThreadStaker::Args> args, CChainParams | |
} | ||
static std::atomic<uint64_t> time{0}; | ||
if (GetSystemTimeInSeconds() - time > 120) { | ||
LogPrintf("ThreadStaker: unlock wallet to start minting...\n"); | ||
LogPrint(BCLog::STAKING, "ThreadStaker: unlock wallet to start minting...\n"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we want to do this, as this is a user actionable item. If this log is being displayed, it's to prompt to user to either unlock, or remove gen=1 if the intent is not to stake. |
||
time = GetSystemTimeInSeconds(); | ||
} | ||
std::this_thread::sleep_for(std::chrono::milliseconds(100)); | ||
} | ||
} | ||
|
||
LogPrintf("ThreadStaker: started.\n"); | ||
LogPrint(BCLog::STAKING, "ThreadStaker: started.\n"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a single log message per staker. Better to leave an auditable log point. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will change it back |
||
|
||
while (!args.empty()) { | ||
boost::this_thread::interruption_point(); | ||
|
||
while (fImporting || fReindex) { | ||
boost::this_thread::interruption_point(); | ||
|
||
LogPrintf("ThreadStaker: waiting reindex...\n"); | ||
LogPrint(BCLog::STAKING, "ThreadStaker: waiting reindex...\n"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A better approach here would be use a throttled logger method for staking log, that throttles psuedo actionable info, like |
||
|
||
std::this_thread::sleep_for(std::chrono::milliseconds(900)); | ||
} | ||
|
@@ -951,23 +951,23 @@ void ThreadStaker::operator()(std::vector<ThreadStaker::Args> args, CChainParams | |
status = staker.stake(chainparams, arg); | ||
} | ||
if (status == Staker::Status::error) { | ||
LogPrintf("ThreadStaker: (%s) terminated due to a staking error!\n", operatorName); | ||
LogPrint(BCLog::STAKING, "ThreadStaker: (%s) terminated due to a staking error!\n", operatorName); | ||
it = args.erase(it); | ||
continue; | ||
} | ||
else if (status == Staker::Status::minted) { | ||
LogPrintf("ThreadStaker: (%s) minted a block!\n", operatorName); | ||
LogPrint(BCLog::STAKING, "ThreadStaker: (%s) minted a block!\n", operatorName); | ||
nMinted[arg.operatorID]++; | ||
} | ||
else if (status == Staker::Status::initWaiting) { | ||
LogPrintf("ThreadStaker: (%s) waiting init...\n", operatorName); | ||
LogPrint(BCLog::STAKING, "ThreadStaker: (%s) waiting init...\n", operatorName); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about instead, we keep the first 2 unchanged. However, for the |
||
} | ||
else if (status == Staker::Status::stakeWaiting) { | ||
LogPrint(BCLog::STAKING, "ThreadStaker: (%s) Staked, but no kernel found yet.\n", operatorName); | ||
} | ||
} | ||
catch (const std::runtime_error &e) { | ||
LogPrintf("ThreadStaker: (%s) runtime error: %s\n", e.what(), operatorName); | ||
LogPrint(BCLog::STAKING, "ThreadStaker: (%s) runtime error: %s\n", e.what(), operatorName); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, I believe both of these should be clearly auditable points to verify what happened, either if orphaned txs are used somewhere prematurely or if there was an error. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will change them back to LogPrintf as before 👍 |
||
|
||
// Could be failed TX in mempool, wipe mempool and allow loop to continue. | ||
LOCK(cs_main); | ||
|
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.
How about we leave this to staking log, but instead tweak the other (
LogPrint(BCLog::STAKING, "ThreadStaker: (%s) minted a block!\n", operatorName);
) one to always print since that's more informative?