Move AbortNode to the top of main.cpp
It is in an anonymous namespace, so it needs to be above all code in the file that uses it.
This commit is contained in:
parent
4cae370328
commit
10b9d6306b
36
src/main.cpp
36
src/main.cpp
|
@ -113,6 +113,24 @@ const string strMessageMagic = "Zcash Signed Message:\n";
|
||||||
// Internal stuff
|
// Internal stuff
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
/** Abort with a message */
|
||||||
|
bool AbortNode(const std::string& strMessage, const std::string& userMessage="")
|
||||||
|
{
|
||||||
|
strMiscWarning = strMessage;
|
||||||
|
LogPrintf("*** %s\n", strMessage);
|
||||||
|
uiInterface.ThreadSafeMessageBox(
|
||||||
|
userMessage.empty() ? _("Error: A fatal internal error occurred, see debug.log for details") : userMessage,
|
||||||
|
"", CClientUIInterface::MSG_ERROR);
|
||||||
|
StartShutdown();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AbortNode(CValidationState& state, const std::string& strMessage, const std::string& userMessage="")
|
||||||
|
{
|
||||||
|
AbortNode(strMessage, userMessage);
|
||||||
|
return state.Error(strMessage);
|
||||||
|
}
|
||||||
|
|
||||||
struct CBlockIndexWorkComparator
|
struct CBlockIndexWorkComparator
|
||||||
{
|
{
|
||||||
bool operator()(CBlockIndex *pa, CBlockIndex *pb) const {
|
bool operator()(CBlockIndex *pa, CBlockIndex *pb) const {
|
||||||
|
@ -2236,24 +2254,6 @@ bool UndoReadFromDisk(CBlockUndo& blockundo, const CDiskBlockPos& pos, const uin
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Abort with a message */
|
|
||||||
bool AbortNode(const std::string& strMessage, const std::string& userMessage="")
|
|
||||||
{
|
|
||||||
strMiscWarning = strMessage;
|
|
||||||
LogPrintf("*** %s\n", strMessage);
|
|
||||||
uiInterface.ThreadSafeMessageBox(
|
|
||||||
userMessage.empty() ? _("Error: A fatal internal error occurred, see debug.log for details") : userMessage,
|
|
||||||
"", CClientUIInterface::MSG_ERROR);
|
|
||||||
StartShutdown();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AbortNode(CValidationState& state, const std::string& strMessage, const std::string& userMessage="")
|
|
||||||
{
|
|
||||||
AbortNode(strMessage, userMessage);
|
|
||||||
return state.Error(strMessage);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // anon namespace
|
} // anon namespace
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue