<commit_before>// Copyright (c) 2014-2018 Fluttercoin Developers
//
// Alert system
//

#include <boost/foreach.hpp>
#include <map>

#include "alert.h"
#include "key.h"
#include "net.h"
#include "sync.h"
#include "ui_interface.h"

using namespace std;

map<uint256, CAlert> mapAlerts;
CCriticalSection cs_mapAlerts;

// old alert keys
// static const char* pszMainKey = "<KEY>";
// TestNet
// static const char* pszTestKey = "<KEY>";

// new alert keys ofeefee 2014-07-10 05:59:14
   static const char* pszMainKey = "04f750b25eabbba1ac3c251475c6a6a435d36ef484b0ed3a1bbc4d03d66990c3574a4c763f0ff7a47ef7c07e2a09daaa457bd6224b427639beb7cc368631ca305d";
// TestNet
   static const char* pszTestKey = "0462fdfd3715415b538267a16620a9406f849b2de355ed8d0d856e962d1d5862d0b5416f9354966381ab80e6f918def726ab7f84fac9daad9b5952993b236f295f";

void CUnsignedAlert::SetNull()
{
    nVersion = 1;
    nRelayUntil = 0;
    nExpiration = 0;
    nID = 0;
    nCancel = 0;
    setCancel.clear();
    nMinVer = 0;
    nMaxVer = 0;
    setSubVer.clear();
    nPriority = 0;

    strComment.clear();
    strStatusBar.clear();
    strReserved.clear();
}

std::string CUnsignedAlert::ToString() const
{
    std::string strSetCancel;
    BOOST_FOREACH(int n, setCancel)
        strSetCancel += strprintf("%d ", n);
    std::string strSetSubVer;
    BOOST_FOREACH(std::string str, setSubVer)
        strSetSubVer += "\"" + str + "\" ";
    return strprintf(
        "CAlert(\n"
        "    nVersion     = %d\n"
        "    nRelayUntil  = %"PRI64d"\n"
        "    nExpiration  = %"PRI64d"\n"
        "    nID          = %d\n"
        "    nCancel      = %d\n"
        "    setCancel    = %s\n"
        "    nMinVer      = %d\n"
        "    nMaxVer      = %d\n"
        "    setSubVer    = %s\n"
        "    nPriority    = %d\n"
        "    strComment   = \"%s\"\n"
        "    strStatusBar = \"%s\"\n"
        ")\n",
        nVersion,
        nRelayUntil,
        nExpiration,
        nID,
        nCancel,
        strSetCancel.c_str(),
        nMinVer,
        nMaxVer,
        strSetSubVer.c_str(),
        nPriority,
        strComment.c_str(),
        strStatusBar.c_str());<commit_msg>formatting changes<commit_after>// Copyright (c) 2014-2018 Fluttercoin Developers
//
// Alert system
//

#include <boost/foreach.hpp>
#include <map>

#include "alert.h"
#include "key.h"
#include "net.h"
#include "sync.h"
#include "ui_interface.h"

using namespace std;

map<uint256, CAlert> mapAlerts;
CCriticalSection cs_mapAlerts;

// old alert keys
// static const char* pszMainKey = "<KEY>";
// TestNet
// static const char* pszTestKey = "<KEY>";

// new alert keys ofeefee 2014-07-10 05:59:14
   static const char* pszMainKey = "04f750b25eabbba1ac3c251475c6a6a435d36ef484b0ed3a1bbc4d03d66990c3574a4c763f0ff7a47ef7c07e2a09daaa457bd6224b427639beb7cc368631ca305d";
// TestNet
   static const char* pszTestKey = "0462fdfd3715415b538267a16620a9406f849b2de355ed8d0d856e962d1d5862d0b5416f9354966381ab80e6f918def726ab7f84fac9daad9b5952993b236f295f";

void CUnsignedAlert::SetNull()
{
    nVersion = 1;
    nRelayUntil = 0;
    nExpiration = 0;
    nID = 0;
    nCancel = 0;
    setCancel.clear();
    nMinVer = 0;
    nMaxVer = 0;
    setSubVer.clear();
    nPriority = 0;

    strComment.clear();
    strStatusBar.clear();
    strReserved.clear();
}

std::string CUnsignedAlert::ToString() const
{
    std::string strSetCancel;
    BOOST_FOREACH(int n, setCancel)
        strSetCancel += strprintf("%d ", n);
    std::string strSetSubVer;
    BOOST_FOREACH(std::string str, setSubVer)
        strSetSubVer += "\"" + str + "\" ";
    return strprintf(
        "CAlert(\n"
        "    nVersion     = %d\n"
        "    nRelayUntil  = %" PRI64d"\n"
        "    nExpiration  = %" PRI64d"\n"
        "    nID          = %d\n"
        "    nCancel      = %d\n"
        "    setCancel    = %s\n"
        "    nMinVer      = %d\n"
        "    nMaxVer      = %d\n"
        "    setSubVer    = %s\n"
        "    nPriority    = %d\n"
        "    strComment   = \"%s\"\n"
        "    strStatusBar = \"%s\"\n"
        ")\n",
        nVersion,
        nRelayUntil,
        nExpiration,
        nID,
        nCancel,
        strSetCancel.c_str(),
        nMinVer,
        nMaxVer,
        strSetSubVer.c_str(),
        nPriority,
        strComment.c_str(),
        strStatusBar.c_str());
{'fraction_non_alphanumeric': 0.1288244766505636, 'fraction_numerical': 0.09293765815504947, 'mean_word_length': 2.365325077399381, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1299594', 'n_tokens_mistral': 1921, 'n_tokens_neox': 1696, 'n_words': 284}