diff --git a/src/main.cpp b/src/main.cpp index 40b9555a4c..9aa1c37a50 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8017,47 +8017,47 @@ bool MemorizeMessage(const CTransaction &tx, double dAmount, std::string sRecipi { const std::string &msg = tx.hashBoinc; const int64_t &nTime = tx.nTime; - if (msg.empty()) return false; - bool fMessageLoaded = false; - - if (Contains(msg,"")) - { - std::string sMessageType = ExtractXML(msg,"",""); - std::string sMessageKey = ExtractXML(msg,"",""); - std::string sMessageValue = ExtractXML(msg,"",""); - std::string sMessageAction = ExtractXML(msg,"",""); - std::string sSignature = ExtractXML(msg,"",""); - std::string sMessagePublicKey = ExtractXML(msg,"",""); - if (sMessageType=="beacon" && Contains(sMessageValue,"INVESTOR")) - { - sMessageValue=""; - } - - if (sMessageType=="superblock") - { - // Deny access to superblock processing runtime data - sMessageValue=""; - } - - if (!sMessageType.empty() && !sMessageKey.empty() && !sMessageValue.empty() && !sMessageAction.empty() && !sSignature.empty()) - { - //Verify sig first - bool Verified = CheckMessageSignature(sMessageAction,sMessageType,sMessageType+sMessageKey+sMessageValue, - sSignature,sMessagePublicKey); - - if (Verified) - { - if (sMessageAction=="A") - { - /* With this we allow verifying blocks with stupid beacon */ - if("beacon"==sMessageType) - { - std::string out_cpid = ""; - std::string out_address = ""; - std::string out_publickey = ""; - GetBeaconElements(sMessageValue, out_cpid, out_address, out_publickey); + if (msg.empty()) return false; + bool fMessageLoaded = false; + + if (Contains(msg,"")) + { + std::string sMessageType = ExtractXML(msg,"",""); + std::string sMessageKey = ExtractXML(msg,"",""); + std::string sMessageValue = ExtractXML(msg,"",""); + std::string sMessageAction = ExtractXML(msg,"",""); + std::string sSignature = ExtractXML(msg,"",""); + std::string sMessagePublicKey = ExtractXML(msg,"",""); + if (sMessageType=="beacon" && Contains(sMessageValue,"INVESTOR")) + { + sMessageValue=""; + } + + if (sMessageType=="superblock") + { + // Deny access to superblock processing runtime data + sMessageValue=""; + } + + if (!sMessageType.empty() && !sMessageKey.empty() && !sMessageValue.empty() && !sMessageAction.empty() && !sSignature.empty()) + { + //Verify sig first + bool Verified = CheckMessageSignature(sMessageAction,sMessageType,sMessageType+sMessageKey+sMessageValue, + sSignature,sMessagePublicKey); + + if (Verified) + { + if (sMessageAction=="A") + { + /* With this we allow verifying blocks with stupid beacon */ + if("beacon"==sMessageType) + { + std::string out_cpid = ""; + std::string out_address = ""; + std::string out_publickey = ""; + GetBeaconElements(sMessageValue, out_cpid, out_address, out_publickey); WriteCache(Section::BEACONALT, sMessageKey+"."+ToString(nTime),out_publickey,nTime); - } + } try { @@ -8073,18 +8073,18 @@ bool MemorizeMessage(const CTransaction &tx, double dAmount, std::string sRecipi error("Attempting to add to unknown cache: %s", sMessageType); } - fMessageLoaded = true; - if (sMessageType=="poll") - { + fMessageLoaded = true; + if (sMessageType=="poll") + { msPoll = msg; - } - } - else if(sMessageAction=="D") - { - if (fDebug10) LogPrintf("Deleting key type %s Key %s Value %s", sMessageType, sMessageKey, sMessageValue); - if(fDebug10 && sMessageType=="beacon" ){ - LogPrintf("BEACON DEL %s - %s", sMessageKey, TimestampToHRDate(nTime)); - } + } + } + else if(sMessageAction=="D") + { + if (fDebug10) LogPrintf("Deleting key type %s Key %s Value %s", sMessageType, sMessageKey, sMessageValue); + if(fDebug10 && sMessageType=="beacon" ){ + LogPrintf("BEACON DEL %s - %s", sMessageKey, TimestampToHRDate(nTime)); + } try { @@ -8098,20 +8098,20 @@ bool MemorizeMessage(const CTransaction &tx, double dAmount, std::string sRecipi error("Attempting to add to unknown cache: %s", sMessageType); } } - // If this is a boinc project, load the projects into the coin: - if (sMessageType=="project" || sMessageType=="projectmapping") - { - //Reserved - fMessageLoaded = true; - } + // If this is a boinc project, load the projects into the coin: + if (sMessageType=="project" || sMessageType=="projectmapping") + { + //Reserved + fMessageLoaded = true; + } - if(fDebug) + if(fDebug) WriteCache(Section::TRXID, sMessageType + ";" + sMessageKey,tx.GetHash().GetHex(),nTime); - } - } + } + } } - return fMessageLoaded; + return fMessageLoaded; } double GRCMagnitudeUnit(int64_t locktime) diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 3628aeffaf..e891043981 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -128,7 +128,8 @@ UniValue getmininginfo(const UniValue& params, bool fHelp) } obj.pushKV("MiningInfo 1", msMiningErrors); - obj.pushKV("MiningInfo 2", msPoll); + std::string sMessageKey = ExtractXML(msPoll, "", ""); + obj.pushKV("MiningInfo 2", "Poll: " + sMessageKey.substr(0,80)); obj.pushKV("MiningInfo 5", msMiningErrors5); obj.pushKV("MiningInfo 6", msMiningErrors6); obj.pushKV("MiningInfo 7", msMiningErrors7);