@@ -2542,7 +2542,7 @@ bool DisconnectBlock(const CBlock& block, CValidationState& state, const CBlockI
25422542 } else if (prevout.scriptPubKey .IsPayToPublicKey () || prevout.scriptPubKey .IsColdStaking ()) {
25432543 uint160 hashBytes;
25442544 int type = 0 ;
2545- CTxDestination destination;
2545+ CTxDestination destination;
25462546 ExtractDestination (prevout.scriptPubKey , destination);
25472547 CNavCoinAddress address (destination);
25482548 if (prevout.scriptPubKey .IsColdStaking ())
@@ -6260,6 +6260,11 @@ void static CheckBlockIndex(const Consensus::Params& consensusParams)
62606260}
62616261
62626262std::string GetWarnings (const std::string& strFor)
6263+ {
6264+ return GetWarnings (strFor, false );
6265+ }
6266+
6267+ std::string GetWarnings (const std::string& strFor, bool fForStaking )
62636268{
62646269 string strStatusBar;
62656270 string strRPC;
@@ -6275,7 +6280,6 @@ std::string GetWarnings(const std::string& strFor)
62756280 strStatusBar = " This is a Release Candidate build - use at your own risk - please make sure your wallet is backed up" ;
62766281 strGUI = _ (" This is a Release Candidate build - use at your own risk - please make sure your wallet is backed up" );
62776282 }
6278-
62796283 }
62806284
62816285 if (GetBoolArg (" -testsafemode" , DEFAULT_TESTSAFEMODE))
@@ -6290,20 +6294,38 @@ std::string GetWarnings(const std::string& strFor)
62906294 if (fLargeWorkForkFound )
62916295 {
62926296 strStatusBar = strRPC = " Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues." ;
6293- strGUI = _ (" Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. " );
6297+ strGUI = _ (strRPC. c_str () );
62946298 }
62956299 else if (fLargeWorkInvalidChainFound )
62966300 {
62976301 strStatusBar = strRPC = " Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade." ;
6298- strGUI = _ (" Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade." );
6302+ strGUI = _ (strRPC.c_str ());
6303+ }
6304+
6305+ if (fForStaking )
6306+ {
6307+ if (pwalletMain->IsLocked ())
6308+ {
6309+ strStatusBar = strRPC = " Warning: Wallet is locked. Please enter the wallet passphrase with walletpassphrase first." ;
6310+ strGUI = _ (strRPC.c_str ());
6311+ }
6312+
6313+ if (!pwalletMain->GetStakeWeight ())
6314+ {
6315+ strStatusBar = strRPC = " Warning: We don't appear to have mature coins." ;
6316+ strGUI = _ (strRPC.c_str ());
6317+ }
62996318 }
63006319
63016320 if (strFor == " gui" )
63026321 return strGUI;
6303- else if (strFor == " statusbar" )
6322+
6323+ if (strFor == " statusbar" )
63046324 return strStatusBar;
6305- else if (strFor == " rpc" )
6325+
6326+ if (strFor == " rpc" )
63066327 return strRPC;
6328+
63076329 assert (!" GetWarnings(): invalid parameter" );
63086330 return " error" ;
63096331}
@@ -7120,7 +7142,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
71207142 CTransaction tx;
71217143 vRecv >> tx;
71227144
7123- LogPrint (" net" , " Received tx %s peer=%d\n %s\n " , tx.GetHash ().ToString (), pfrom->id , tx.ToString ());
7145+ LogPrint (" net" , " Received tx %s peer=%d\n %s\n " , tx.GetHash ().ToString (), pfrom->id , tx.ToString ());
71247146
71257147 CInv inv (MSG_TX, tx.GetHash ());
71267148 pfrom->AddInventoryKnown (inv);
0 commit comments