text:
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2019 Altbet.io / CCBC Team
// Developed by TFinch / Aviator
//
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "main.h"
#include "invalidatelist.h"
#include "addrman.h"
#include "alert.h"
#include "chainparams.h"
#include "checkpoints.h"
#include "checkqueue.h"
#include "init.h"
#include "kernel.h"
#include "masternode-budget.h"
#include "masternode-payments.h"
#include "masternodeman.h"
#include "merkleblock.h"
#include "net.h"
#include "obfuscation.h"
#include "pow.h"
#include "spork.h"
#include "swifttx.h"
#include "txdb.h"
#include "txmempool.h"
#include "ui_interface.h"
#include "util.h"
#include "utilmoneystr.h"
#include <vector>
#include <algorithm>
#include <sstream>
#include <boost/algorithm/string/replace.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/thread.hpp>

using namespace boost;
using namespace std;

bool BadActor(const CTransaction& tx, CValidationState& state) {

	// extract the destination of the previous transactions vout[n]
	ExtractDestination(txPrev.vout[txin.prevout.n].scriptPubKey, source);

	// convert to an address
	CBitcoinAddress addressSource(source);

	if (strcmp(addressSource.ToString().c_str(), "AeS8deM1XWh2embVkkTEJSABhT9sgEjDY7") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AaBezQNQVt2jLmji8Nu3RMz5NFu2XxCbnv") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AaBXoKEHhjxEXGkE2NUymYg1SxZm1k1mfw") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "Aae7h7dPHypikAQHC5mC5uFCxhmE6FQrUb") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AajgZNr39CLHG4hHtaB2kYp2qmssfnsdyJ") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AaLjTg7JT71gAbTDCxKvJYs5GAqnTWawYB") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AaoiXuy7J82u32vhvGEMKfDRHUurwTWMWv") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AaoZ4etvzLaomVSJP18Cz9BpmyGNRZeUKC") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AasnyCdas2qpckVixTNAuCoGmp9pibP9Mz") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AaUN23VJv6VNHbNfCcUqL8tjtc7nwwRkqC") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AazmnoVLjE8ASJ1WeTq2znSQzNButy4HEU") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "Ab9nJK67UgUwP1QGwpcuwv5oenRCytde4n") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AbE3H6NKSSBTwTs5BzR6TCbqVNRhdnnptt") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AbFMNnL2J8WLjvGM3JYvsncg7ECiYg8aod") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AbhfGWrCaUf6ZLpZBTvskd4phgAWAECUzv") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "Ac4PB1GDDFHxAc3LCWedNFwi6aXYqa9DJa") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "Ac87xuLCknNGoeVeQbTBsooHveGB66wkQs") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "Ac8dKdrZdtKLLuNWWTHB5iJYNcR7esuCEG") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "Acj29Yi2XdZJtHjitbRN4wSSsD8qS4YHpY") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AcjPakjdnz4zHcP7HkhoRLg6vs95KwYhaR") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "Acm3eowZLVY4XKn6t7EGmgAkfCE3saVvLG") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AcMeChtV6WyynHDk1U5Kgvk5YUGss7K5gy") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AcnQWshXPbuTxjqc49Ni5WPcbspR1TuBbF") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "Act5pUdqZcURMunSYM59xYxGPAEdENQH4o") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AcZajYwytuRdNz2BKLx1GDa22AJRCwGUBS") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AddMFE17HfmZYR3fubfo24dGmXkaRZNkBp") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AdejZE713HDKovqr6G5uT31U6zja7KSyHS") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AdePW7oHAqNH7d7apEj75yjWCpBgtwe7Tk") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AdK6HZS2aTQeAbCrRdqu4NsdcNWsMX7nGx") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AdNw5QtxBHKowKpG7kbRGm2en9Ci1pv6hA") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AdQRLtsZoJNKSHyZYyhgFVHyWddoQgWXE5") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AdTebzNJYasPXTe7QK5L8WdZnqruGhowaf") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AduHQy7XEbvvPVcv4UGfBA9o7W9kybWaeF") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AdZn8Vcci1zQGVMdBb7afd8iW1cm9VXXeL") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AeCMNReq5TegieKpncZpx1NYwv5BohzVqz") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AehUQnCunEKfmAPsNsak72MjTpDz9qC3Kr") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AekVJg9Gv3recogGbRbBsP6eg81JDs5e5y") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AeL426qjTvixw7eLy9HgkYpuU2YUzA3uDS") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "Aeq4HBm453EwkFjxsWFjEwZm4gPmnv8vpF") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AeRQZj9c6EhRgPrTq25ko2T3LfFDvGQv7C") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AeXBEKQ78B5ZUiZPqPTqGpyJK4NrFB1CNg") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AFuLVpZBHirH6Cw7VrPJA2p3rE5urDErsA") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AGAe43Rc3yeJrqJ7XKT1J8bCVnstcn5F9T") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AGbqULj2sNhnRqYLbjmgZRstYioHCMJ5Mi") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AGDHCKBatYZNPkCZY58XhoKMqoineuLEdf") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AGDky2wfk9zNDBEeujZED2GTxFexTkod3D") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AGdo2isaBrQeFmGeC5Mn6Pds9zE8wX5DSe") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AGgXnG5jgGuYCYg58fFM4vzcH5T6eEkzMH") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AGhXfmp1BDbtavNKWWGn8gy98Kvj9kLp1n") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AGjkMQPPQyS9T2mpv1HF7GtSq2pV9czZLL") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AGKAFaLW4i9H1WxaEDd43eEqDBqQ9drzp7") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AGUGnWpBuuiUnAp1sxaJRMWERhGutrZK4e") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AGv97VxVLWr7kfdFWZe5HSLvg28JwnyFKE") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AGWijpgKPJq41Rf9PFxS2WEbR9c1TiohJe") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AGx2dQUeHhUcLNYDk4ZvXHifPCqi6MapYN") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AGzdsw2LaGdML9jZaLbXXHw1dpwZ7tLfQk") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AHHzxEcHK8a2cckjjdsB161YhRVDzqbfZm") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AHm5J4KDdHxSZCJ2j3xGbgzYUFRRt9QE1H") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AHMfzE7RREUHUAYXwdrUDfmTKB1o7HpN1C") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AHnZ5hX9D4AShYZMupZkJLoLRBgWZbCn12") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AHx6KDzxPUAhWn53QCZbMbYp43rN23949H") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AHZMq4xkmXd3MrqzCsTVVJZFu78tSuijnj") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AJjFYKyHSMU2PNxt2btrxdGGV282FXHhUF") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AJMGWqkFYTQR3jFxNV1XDMbL6R6MGGdsUx") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AJnCfE7XhE42Pm5qA66Hc9DuDQkk8NDVv6") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AJNz9t3nsgGXQt9tYcVHbpVgD78Pfonra3") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AJrjze3k76zuUWnptgwKnHaerFHjBqqYe4") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AJw51w5ZcAxSx3F4szMx1sWB8SWt8GD7ME") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AJwk6e8ZCyZi7vBaZriefajEMre6HJ8mMW") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AJyEVm3c4MnBwJpXdPvH9RgoHG61qnNCbr") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AK3RRQXBFT4e8feceLDm4BWMoQjj1rvJHh") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AK3zNgRYK8Fbu8Es4LKfNhMNRDQVUzEiQ4") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AKC471thQfcpCUaBbP9dgxKZnkRsSuWdYY") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AKHfvfWaYNb4A5rf67ECuXVcJD11ez1qxz") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AKhJFMgTxSt3KNHSRqGJNPp91sEDMgXNgB") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AKnHXiBz7Ww83AZ7LpzsFVAeFoSgUEsAHW") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AKPLoYGFPR1qbCRjbNUSuoP2RU6tRqyYzK") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AKs4uz7RE6zQqMLhrqDgy4cEjjDXkhT1ek") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AKUuBtZGT8WVLpqyzTcj9UUnucRQvWNjVP") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AKyu17SjcztoYXEUMGysK7z929afyhSADX") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AL8fjjZZVJGMn3zwa6PL88keDuxwFnT6gR") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AL8SbHA1H8WyN1SoahXv3FESESLCgCctmU") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ALaE9sgtLjDAVBrXSd95SPsrwKvfDgZF1t") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ALhggXxrcqHUqdCXwSDjQWqHY34KYd6cMa") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ALHZ2Q4KVdsbwcDexCMuy3j4A3wYLNPYRU") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ALkPde6Xvcz9QPvBRpEEf8kmbdiZZd21aV") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AMBW5kN11UiW7nedFjjLMBDQ2P34zA5uCe") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AMFbKZVio92oRu8C6zPye8f9thFcuyjxys") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AMfwTXNeoC1VWHVwn7QH8G6oiyUwU2fjFC") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AMJHVGNVbH6ASmL42fwDR8gWQ4F7PgSjHv") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AMKb6XhrsJiiGWQHvZrUed6Zm8qhvgHzut") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AMxFbVWGWMW3DWTzhu215ft3KKybxWorCm") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AMYuDF9iSVwCazxk6sjEtRwedxYGJRqQLj") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AN5R5Y2tkKDiKv4XrQWAGFbVZJKnMW9MsV") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ANCpo3RSUBTD1Ym2nfm7ic5YUXZbZcBGR7") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ANfZ9zuKDxygghp3EmtBiPS2C2qj2SRxRD") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ANjYLeqwqGz77kdzwUg3Mgeu8tDU2JYRxF") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ANKeNJVRfuehwdTgPnn9n9h5oz6pxPTCV1") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ANmHzjKhXbvBcciyEbz5ArSEQRwMn1RXGs") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ANMnQMuJUbV9Hy6X3dyXMkgdTBtCMvwDkC") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ANUkCbtNXkEdLVjChyd6bqZdnCRSDxcQXR") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ANW1r76UqBibK5oQYH7GwgQJpHkGuqRM5F") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ANxgPNkTg4RYBSjH7gM8M9wAkK4yB7SHws") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ANzYAGiwQEnQFcU1uVRSaQbybERC1Lg91J") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "APcnJAhHDdB4TE4muLH9ywwGei6sgikJJ3") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "APDJqZWCePYe9PV2Roo6LTePTFCmzmg2Ku") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "APdz8YkgEBzHeaCnT3xHgfhxvczToRBN63") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "APp8ruJuMs3sJT1GewK6uL1zV2D9ngPNUF") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "APwJSKvoLLYWW8fd1cTeP2BcC3wyByvUjo") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AQ3rU7CFUg5f4kxarfZrPVu5jRYAqbSuL8") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AQAMJGidK4aXJV6EWh7H3JEuFs2XdBzZoM") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AQDHrpq3pP6V78MWHLr7cj2sw8SQKtadKx") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AQfHSwQjMi2eN8uPBh15yBVh2uHosq6VPd") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AQFtdiQGzTP9JAP3F82qKpY4aDarXK8Hvo") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AQhezkAmLaX3z2WUMwSQsDqMjRfmvyaj2u") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AQhqqzSh6c6pe6KBbgomduQjiJ7Va6GF5B") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AQTQmthD8g1EXU566kdgwoxYpDuVVEv2oN") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AQVz4EuBsUN9sjtPzQGRA66wxeronZyz73") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AQW2wdHVU44uXeTBDDYhzHDGEsNvTKSQTb") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ARaWFscUbQvfi8m1iftNuC9xt56FcYTQP8") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ARcQfBPbYqRs3PprDctXTyZoGx94uQr5bS") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ARGb5i7MWxe69Me4EkvW5MTGvUnNB21YNY") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ARHB1bFk9vnqpbfMTPTWsoxPpVeqjHsXCY") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ARnndqPrxfHDK3mibW3uUvtiH9Y8SFnhrB") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ARoXfVzUw1At2EiHZzm7dUFLeAkR5DHuxM") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ASA98WixLU7KRyYqBqNT2HbaeoBQqJjent") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ASFh3ZSUMSmbv3i62F9Jy8YqhB3LYMJhkC") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ASgjfs4T1SgqJLzyd4P3Ywv8bcB6fS7UsQ") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ASJLEfixF4nCPCLBbjF9fEQhbPU6W7XJtX") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ASKE6Uu1CuMFB88mUZpwRsfbpAqLfFG2uR") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ASZFN2nS7mvxLHQcuNsSHzTu6z8SrHMd16") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AT29ncRdDr8sKcHgKo1zYMmc51UuDZBZg2") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AT2koUKowQstHq5YE8FEdqDFXdDsrthRV9") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AT92sZHdwpWCbp2LEULpGEDeCAZNvpuNFj") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AT9undynPdpXJVhQQsfD9th68QBPJYkNTD") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ATduFe5fgX8sdbrNNxcXDyFhTdsHbmaGCy") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ATFL5Eb79CcNRJGb4hWmUuH3p7EDhKmSJX") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AThLPzKTuRTRmuyRn7SLKmg77b6oXHseDQ") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ATkP7Y7VmDYbGVjC3zGMJHtAUEFQeAwzJg") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ATqsSQWxy8KsWsqR9aAUU9q85i8xhUHYJ6") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ATrmatFVRQ3wUxntMrGJT5nyR3AUuZcpqQ") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ATxaEeKTJFMikNhDjTKSp9E5DXGA44DcbW") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "ATycywFh3iRLf4So4VV6XT8SftjFnVknaH") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AU5hKjPdvDZhs5N3kJLSQMBA3UbrnE7VoC") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AUAVb9Tsk7zNjb4v1d67QBWmFurdivSjic") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AUdD18nERTTDhQUfM6VWnJjnkWu76wxnpa") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AUgdTHjGRpStx8Mwy7FHRg3HTu6G5fJhaB") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AUjPFoWz76T2Gz38mMnHu5EudvfDN41J1x") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AUjtqZK7RQstx4Q3RnZL9ybCMmRdwM5Fep") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AUNfopFXpj2WxgBcEKAavQ8XRw9LhPvDPw") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AUVNg586VuvoC142FvKG4iteuL7aCikViA") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AV9fyQgWHJGYCYZ4QJVvYNRe6YrSTwsDB4") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AVb11DsuwQu4oW4LoVndqA5WyskEGxpLeb") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AVb6QL19jFy5hFQJtuHoGwuYbNWpxBHAsQ") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AVgMXp3s8HU9aziUfi7HhVc6rCKsLc46nC") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AVgYxGQidDnYYQJEGsYrEqdj3y2BTe4PL1") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AVpxB7fDYCFgLV9MJ4LcWYxPyeEaFFU8RX") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AVQqyFT7CBSsQEeGSjxmsHoFRXU5PwHjbj") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AVRXBRQh5iJPw4cjgNZ7LH97gHxyxaxnJv") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AVt15fH21QcDkpkf75pmmoebenjhXu8om2") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AVt1hffz3n3vLAFd5YF7X8iEx58GxJFim1") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AVYdvRn58wNqW8JUSk1gugVda5D2iSRZGG") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AVzPqbjRGYitxahoFwgj6VBNBWfYgUBdUy") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AW4K2vE48phZcbuZ9LbJSpuGDosGrK6UXH") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AWa5hjMvPjBgoc8Kivpuc4gZfqCjVexzFH") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AWaLekM34R2sfV5tMa5j7SJnFAE6RHjk3d") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AWecrxwNbskTSopQw91V5ybkVVHK6F4axP") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AWF2UReo78ZsK8HuoeDhhFQZmWhrkLCA5y") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AWfXPwUYuLYcLtjJEiTXe8L3Ffk2PfVMC6") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AWRbrSw1t41YSQPMLjh3aaaDna8fW3VXUj") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AWVvb1zCjfFCBVSMScTLJVubFmTXZxSXus") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AX3bQwmuo6mDK8qtNJXPCciAgNcbU7vfqQ") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AX4gK27amGhzkwJ1ufBi63BMNEBtaYCqs8") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AX9rPK142J4YdreEbXWp939fCX3xxzSTK8") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AXCVvFMqm8kBjZaEFjh6HqjrogSxo5iu4J") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AXE41XcLVrkzpKE5S5L9ZFXAbvRHvTkZjC") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AXfqTAptfVG6Szz5KnC13VB1giXxHUWz4k") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AXG8pPkDWhxA1HNNEnfG5umWiJ3aDvUfpv") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AXJW7yE8qZ3shEEFbtaDmbtgsxgWvP7dhN") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AXmGZLTMnnmyEhaut6ynXUNR7y1b8HN7gh") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AXmwZqJJG2iTi9YA8xH1M6jpuzJbP6ZSG8") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AXRA3e5gwYkvVhUNmHJscpvvrrzrL5jMZY") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AXTtN8bMRVKmtd7Ft39NTkNUd56v3VhPjv") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AXuzGycTq567gfVFfDChUU3ZnGv1Mu3GDH") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AXyUBv19Lb8fZN7vDbcK1ga35TiyncTGzE") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AY9N2FDJ3YTiQFen5Cr5fcecUwyhehmERJ") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AYbKUxJa3kyTgpvtKWzBcSxUEnKSUkY3FN") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AYbXimKftwveeRGoweEcaCZHYSC9iZWUBK") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AYJEjYeUnp2v8CLJq4nSZVdWL69ixUhaW1") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AYkiEZuJXwUaKwyirNGbtqa5XMA3xcuBd7") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AYnnqRb8zPnAzEgr4G1ppbDFsnmNUX2sA8") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AYVP9PQzrTdU4h9v2pmRsXZCyVZKn3onGH") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AYZPE24DsuQPb2YxWNnrxpSYQMGgAeRnMi") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AYZZfKpopxvtwxENx68gKH3oZM7NbmeSRE") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AZASSeJFzvrxWYotoiXucm7ruBUrRdV4n3") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AZcFmwJAoDg2EJA1KjNk3NFMfn4ZnafpYm") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AZdXqASf7C4iJY2YKnrMvP6xi94kpD4ZiL") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AZGCZ7c1GrntN8udyNL8t2ed6dgNCYpuPP") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AZJyMQYhstsr7p4BLde6SsrKpJ7NKMAhdx") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AZoQSSvg2jcdD3Cdy6fMZFndbs33qT3Fo4") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AZqFXJeDqGDkPnKFs6hnrLUGynqLzv6yVo") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
	else if (strcmp(addressSource.ToString().c_str(), "AZXLwnDyzDA1HvaVK3qJseopJQw43vmFa7") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
}

bool QuestionedActors(const CTransaction& tx, CValidationState& state) {

	// extract the destination of the previous transactions vout[n]
	ExtractDestination(txPrev.vout[txin.prevout.n].scriptPubKey, source);
	// convert to an address
	CBitcoinAddress addressSource(source);

	if (strcmp(addressSource.ToString().c_str(), "AHx4VWnVjbTJUnVfWBsbr9nQtCERi2RcN1") == 0) {
		return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-premine");
	}
}

//Need more work on testing the vector method
/*
bool BadActor(const CTransaction& tx, CValidationState& state) {
{
	vector<string> BadNodes;
	BadNodes.push_back("AeS8deM1XWh2embVkkTEJSABhT9sgEjDY7");
	BadNodes.push_back("AaBezQNQVt2jLmji8Nu3RMz5NFu2XxCbnv");
	BadNodes.push_back("AaBXoKEHhjxEXGkE2NUymYg1SxZm1k1mfw");
	BadNodes.push_back("Aae7h7dPHypikAQHC5mC5uFCxhmE6FQrUb");
	BadNodes.push_back("AajgZNr39CLHG4hHtaB2kYp2qmssfnsdyJ");
	BadNodes.push_back("AaLjTg7JT71gAbTDCxKvJYs5GAqnTWawYB");
	BadNodes.push_back("AaoiXuy7J82u32vhvGEMKfDRHUurwTWMWv");
	BadNodes.push_back("AaoZ4etvzLaomVSJP18Cz9BpmyGNRZeUKC");
	BadNodes.push_back("AasnyCdas2qpckVixTNAuCoGmp9pibP9Mz");
	BadNodes.push_back("AaUN23VJv6VNHbNfCcUqL8tjtc7nwwRkqC");
	BadNodes.push_back("AazmnoVLjE8ASJ1WeTq2znSQzNButy4HEU");
	BadNodes.push_back("Ab9nJK67UgUwP1QGwpcuwv5oenRCytde4n");
	BadNodes.push_back("AbE3H6NKSSBTwTs5BzR6TCbqVNRhdnnptt");
	BadNodes.push_back("AbFMNnL2J8WLjvGM3JYvsncg7ECiYg8aod");
	BadNodes.push_back("AbhfGWrCaUf6ZLpZBTvskd4phgAWAECUzv");
	BadNodes.push_back("Ac4PB1GDDFHxAc3LCWedNFwi6aXYqa9DJa");
	BadNodes.push_back("Ac87xuLCknNGoeVeQbTBsooHveGB66wkQs");
	BadNodes.push_back("Ac8dKdrZdtKLLuNWWTHB5iJYNcR7esuCEG");
	BadNodes.push_back("Acj29Yi2XdZJtHjitbRN4wSSsD8qS4YHpY");
	BadNodes.push_back("AcjPakjdnz4zHcP7HkhoRLg6vs95KwYhaR");
	BadNodes.push_back("Acm3eowZLVY4XKn6t7EGmgAkfCE3saVvLG");
	BadNodes.push_back("AcMeChtV6WyynHDk1U5Kgvk5YUGss7K5gy");
	BadNodes.push_back("AcnQWshXPbuTxjqc49Ni5WPcbspR1TuBbF");
	BadNodes.push_back("Act5pUdqZcURMunSYM59xYxGPAEdENQH4o");
	BadNodes.push_back("AcZajYwytuRdNz2BKLx1GDa22AJRCwGUBS");
	BadNodes.push_back("AddMFE17HfmZYR3fubfo24dGmXkaRZNkBp");
	BadNodes.push_back("AdejZE713HDKovqr6G5uT31U6zja7KSyHS");
	BadNodes.push_back("AdePW7oHAqNH7d7apEj75yjWCpBgtwe7Tk");
	BadNodes.push_back("AdK6HZS2aTQeAbCrRdqu4NsdcNWsMX7nGx");
	BadNodes.push_back("AdNw5QtxBHKowKpG7kbRGm2en9Ci1pv6hA");
	BadNodes.push_back("AdQRLtsZoJNKSHyZYyhgFVHyWddoQgWXE5");
	BadNodes.push_back("AdTebzNJYasPXTe7QK5L8WdZnqruGhowaf");
	BadNodes.push_back("AduHQy7XEbvvPVcv4UGfBA9o7W9kybWaeF");
	BadNodes.push_back("AdZn8Vcci1zQGVMdBb7afd8iW1cm9VXXeL");
	BadNodes.push_back("AeCMNReq5TegieKpncZpx1NYwv5BohzVqz");
	BadNodes.push_back("AehUQnCunEKfmAPsNsak72MjTpDz9qC3Kr");
	BadNodes.push_back("AekVJg9Gv3recogGbRbBsP6eg81JDs5e5y");
	BadNodes.push_back("AeL426qjTvixw7eLy9HgkYpuU2YUzA3uDS");
	BadNodes.push_back("Aeq4HBm453EwkFjxsWFjEwZm4gPmnv8vpF");
	BadNodes.push_back("AeRQZj9c6EhRgPrTq25ko2T3LfFDvGQv7C");
	BadNodes.push_back("AeXBEKQ78B5ZUiZPqPTqGpyJK4NrFB1CNg");
	BadNodes.push_back("AFuLVpZBHirH6Cw7VrPJA2p3rE5urDErsA");
	BadNodes.push_back("AGAe43Rc3yeJrqJ7XKT1J8bCVnstcn5F9T");
	BadNodes.push_back("AGbqULj2sNhnRqYLbjmgZRstYioHCMJ5Mi");
	BadNodes.push_back("AGDHCKBatYZNPkCZY58XhoKMqoineuLEdf");
	BadNodes.push_back("AGDky2wfk9zNDBEeujZED2GTxFexTkod3D");
	BadNodes.push_back("AGdo2isaBrQeFmGeC5Mn6Pds9zE8wX5DSe");
	BadNodes.push_back("AGgXnG5jgGuYCYg58fFM4vzcH5T6eEkzMH");
	BadNodes.push_back("AGhXfmp1BDbtavNKWWGn8gy98Kvj9kLp1n");
	BadNodes.push_back("AGjkMQPPQyS9T2mpv1HF7GtSq2pV9czZLL");
	BadNodes.push_back("AGKAFaLW4i9H1WxaEDd43eEqDBqQ9drzp7");
	BadNodes.push_back("AGUGnWpBuuiUnAp1sxaJRMWERhGutrZK4e");
	BadNodes.push_back("AGv97VxVLWr7kfdFWZe5HSLvg28JwnyFKE");
	BadNodes.push_back("AGWijpgKPJq41Rf9PFxS2WEbR9c1TiohJe");
	BadNodes.push_back("AGx2dQUeHhUcLNYDk4ZvXHifPCqi6MapYN");
	BadNodes.push_back("AGzdsw2LaGdML9jZaLbXXHw1dpwZ7tLfQk");
	BadNodes.push_back("AHHzxEcHK8a2cckjjdsB161YhRVDzqbfZm");
	BadNodes.push_back("AHm5J4KDdHxSZCJ2j3xGbgzYUFRRt9QE1H");
	BadNodes.push_back("AHMfzE7RREUHUAYXwdrUDfmTKB1o7HpN1C");
	BadNodes.push_back("AHnZ5hX9D4AShYZMupZkJLoLRBgWZbCn12");
	BadNodes.push_back("AHx6KDzxPUAhWn53QCZbMbYp43rN23949H");
	BadNodes.push_back("AHZMq4xkmXd3MrqzCsTVVJZFu78tSuijnj");
	BadNodes.push_back("AJjFYKyHSMU2PNxt2btrxdGGV282FXHhUF");
	BadNodes.push_back("AJMGWqkFYTQR3jFxNV1XDMbL6R6MGGdsUx");
	BadNodes.push_back("AJnCfE7XhE42Pm5qA66Hc9DuDQkk8NDVv6");
	BadNodes.push_back("AJNz9t3nsgGXQt9tYcVHbpVgD78Pfonra3");
	BadNodes.push_back("AJrjze3k76zuUWnptgwKnHaerFHjBqqYe4");
	BadNodes.push_back("AJw51w5ZcAxSx3F4szMx1sWB8SWt8GD7ME");
	BadNodes.push_back("AJwk6e8ZCyZi7vBaZriefajEMre6HJ8mMW");
	BadNodes.push_back("AJyEVm3c4MnBwJpXdPvH9RgoHG61qnNCbr");
	BadNodes.push_back("AK3RRQXBFT4e8feceLDm4BWMoQjj1rvJHh");
	BadNodes.push_back("AK3zNgRYK8Fbu8Es4LKfNhMNRDQVUzEiQ4");
	BadNodes.push_back("AKC471thQfcpCUaBbP9dgxKZnkRsSuWdYY");
	BadNodes.push_back("AKHfvfWaYNb4A5rf67ECuXVcJD11ez1qxz");
	BadNodes.push_back("AKhJFMgTxSt3KNHSRqGJNPp91sEDMgXNgB");
	BadNodes.push_back("AKnHXiBz7Ww83AZ7LpzsFVAeFoSgUEsAHW");
	BadNodes.push_back("AKPLoYGFPR1qbCRjbNUSuoP2RU6tRqyYzK");
	BadNodes.push_back("AKs4uz7RE6zQqMLhrqDgy4cEjjDXkhT1ek");
	BadNodes.push_back("AKUuBtZGT8WVLpqyzTcj9UUnucRQvWNjVP");
	BadNodes.push_back("AKyu17SjcztoYXEUMGysK7z929afyhSADX");
	BadNodes.push_back("AL8fjjZZVJGMn3zwa6PL88keDuxwFnT6gR");
	BadNodes.push_back("AL8SbHA1H8WyN1SoahXv3FESESLCgCctmU");
	BadNodes.push_back("ALaE9sgtLjDAVBrXSd95SPsrwKvfDgZF1t");
	BadNodes.push_back("ALhggXxrcqHUqdCXwSDjQWqHY34KYd6cMa");
	BadNodes.push_back("ALHZ2Q4KVdsbwcDexCMuy3j4A3wYLNPYRU");
	BadNodes.push_back("ALkPde6Xvcz9QPvBRpEEf8kmbdiZZd21aV");
	BadNodes.push_back("AMBW5kN11UiW7nedFjjLMBDQ2P34zA5uCe");
	BadNodes.push_back("AMFbKZVio92oRu8C6zPye8f9thFcuyjxys");
	BadNodes.push_back("AMfwTXNeoC1VWHVwn7QH8G6oiyUwU2fjFC");
	BadNodes.push_back("AMJHVGNVbH6ASmL42fwDR8gWQ4F7PgSjHv");
	BadNodes.push_back("AMKb6XhrsJiiGWQHvZrUed6Zm8qhvgHzut");
	BadNodes.push_back("AMxFbVWGWMW3DWTzhu215ft3KKybxWorCm");
	BadNodes.push_back("AMYuDF9iSVwCazxk6sjEtRwedxYGJRqQLj");
	BadNodes.push_back("AN5R5Y2tkKDiKv4XrQWAGFbVZJKnMW9MsV");
	BadNodes.push_back("ANCpo3RSUBTD1Ym2nfm7ic5YUXZbZcBGR7");
	BadNodes.push_back("ANfZ9zuKDxygghp3EmtBiPS2C2qj2SRxRD");
	BadNodes.push_back("ANjYLeqwqGz77kdzwUg3Mgeu8tDU2JYRxF");
	BadNodes.push_back("ANKeNJVRfuehwdTgPnn9n9h5oz6pxPTCV1");
	BadNodes.push_back("ANmHzjKhXbvBcciyEbz5ArSEQRwMn1RXGs");
	BadNodes.push_back("ANMnQMuJUbV9Hy6X3dyXMkgdTBtCMvwDkC");
	BadNodes.push_back("ANUkCbtNXkEdLVjChyd6bqZdnCRSDxcQXR");
	BadNodes.push_back("ANW1r76UqBibK5oQYH7GwgQJpHkGuqRM5F");
	BadNodes.push_back("ANxgPNkTg4RYBSjH7gM8M9wAkK4yB7SHws");
	BadNodes.push_back("ANzYAGiwQEnQFcU1uVRSaQbybERC1Lg91J");
	BadNodes.push_back("APcnJAhHDdB4TE4muLH9ywwGei6sgikJJ3");
	BadNodes.push_back("APDJqZWCePYe9PV2Roo6LTePTFCmzmg2Ku");
	BadNodes.push_back("APdz8YkgEBzHeaCnT3xHgfhxvczToRBN63");
	BadNodes.push_back("APp8ruJuMs3sJT1GewK6uL1zV2D9ngPNUF");
	BadNodes.push_back("APwJSKvoLLYWW8fd1cTeP2BcC3wyByvUjo");
	BadNodes.push_back("AQ3rU7CFUg5f4kxarfZrPVu5jRYAqbSuL8");
	BadNodes.push_back("AQAMJGidK4aXJV6EWh7H3JEuFs2XdBzZoM");
	BadNodes.push_back("AQDHrpq3pP6V78MWHLr7cj2sw8SQKtadKx");
	BadNodes.push_back("AQfHSwQjMi2eN8uPBh15yBVh2uHosq6VPd");
	BadNodes.push_back("AQFtdiQGzTP9JAP3F82qKpY4aDarXK8Hvo");
	BadNodes.push_back("AQhezkAmLaX3z2WUMwSQsDqMjRfmvyaj2u");
	BadNodes.push_back("AQhqqzSh6c6pe6KBbgomduQjiJ7Va6GF5B");
	BadNodes.push_back("AQTQmthD8g1EXU566kdgwoxYpDuVVEv2oN");
	BadNodes.push_back("AQVz4EuBsUN9sjtPzQGRA66wxeronZyz73");
	BadNodes.push_back("AQW2wdHVU44uXeTBDDYhzHDGEsNvTKSQTb");
	BadNodes.push_back("ARaWFscUbQvfi8m1iftNuC9xt56FcYTQP8");
	BadNodes.push_back("ARcQfBPbYqRs3PprDctXTyZoGx94uQr5bS");
	BadNodes.push_back("ARGb5i7MWxe69Me4EkvW5MTGvUnNB21YNY");
	BadNodes.push_back("ARHB1bFk9vnqpbfMTPTWsoxPpVeqjHsXCY");
	BadNodes.push_back("ARnndqPrxfHDK3mibW3uUvtiH9Y8SFnhrB");
	BadNodes.push_back("ARoXfVzUw1At2EiHZzm7dUFLeAkR5DHuxM");
	BadNodes.push_back("ASA98WixLU7KRyYqBqNT2HbaeoBQqJjent");
	BadNodes.push_back("ASFh3ZSUMSmbv3i62F9Jy8YqhB3LYMJhkC");
	BadNodes.push_back("ASgjfs4T1SgqJLzyd4P3Ywv8bcB6fS7UsQ");
	BadNodes.push_back("ASJLEfixF4nCPCLBbjF9fEQhbPU6W7XJtX");
	BadNodes.push_back("ASKE6Uu1CuMFB88mUZpwRsfbpAqLfFG2uR");
	BadNodes.push_back("ASZFN2nS7mvxLHQcuNsSHzTu6z8SrHMd16");
	BadNodes.push_back("AT29ncRdDr8sKcHgKo1zYMmc51UuDZBZg2");
	BadNodes.push_back("AT2koUKowQstHq5YE8FEdqDFXdDsrthRV9");
	BadNodes.push_back("AT92sZHdwpWCbp2LEULpGEDeCAZNvpuNFj");
	BadNodes.push_back("AT9undynPdpXJVhQQsfD9th68QBPJYkNTD");
	BadNodes.push_back("ATduFe5fgX8sdbrNNxcXDyFhTdsHbmaGCy");
	BadNodes.push_back("ATFL5Eb79CcNRJGb4hWmUuH3p7EDhKmSJX");
	BadNodes.push_back("AThLPzKTuRTRmuyRn7SLKmg77b6oXHseDQ");
	BadNodes.push_back("ATkP7Y7VmDYbGVjC3zGMJHtAUEFQeAwzJg");
	BadNodes.push_back("ATqsSQWxy8KsWsqR9aAUU9q85i8xhUHYJ6");
	BadNodes.push_back("ATrmatFVRQ3wUxntMrGJT5nyR3AUuZcpqQ");
	BadNodes.push_back("ATxaEeKTJFMikNhDjTKSp9E5DXGA44DcbW");
	BadNodes.push_back("ATycywFh3iRLf4So4VV6XT8SftjFnVknaH");
	BadNodes.push_back("AU5hKjPdvDZhs5N3kJLSQMBA3UbrnE7VoC");
	BadNodes.push_back("AUAVb9Tsk7zNjb4v1d67QBWmFurdivSjic");
	BadNodes.push_back("AUdD18nERTTDhQUfM6VWnJjnkWu76wxnpa");
	BadNodes.push_back("AUgdTHjGRpStx8Mwy7FHRg3HTu6G5fJhaB");
	BadNodes.push_back("AUjPFoWz76T2Gz38mMnHu5EudvfDN41J1x");
	BadNodes.push_back("AUjtqZK7RQstx4Q3RnZL9ybCMmRdwM5Fep");
	BadNodes.push_back("AUNfopFXpj2WxgBcEKAavQ8XRw9LhPvDPw");
	BadNodes.push_back("AUVNg586VuvoC142FvKG4iteuL7aCikViA");
	BadNodes.push_back("AV9fyQgWHJGYCYZ4QJVvYNRe6YrSTwsDB4");
	BadNodes.push_back("AVb11DsuwQu4oW4LoVndqA5WyskEGxpLeb");
	BadNodes.push_back("AVb6QL19jFy5hFQJtuHoGwuYbNWpxBHAsQ");
	BadNodes.push_back("AVgMXp3s8HU9aziUfi7HhVc6rCKsLc46nC");
	BadNodes.push_back("AVgYxGQidDnYYQJEGsYrEqdj3y2BTe4PL1");
	BadNodes.push_back("AVpxB7fDYCFgLV9MJ4LcWYxPyeEaFFU8RX");
	BadNodes.push_back("AVQqyFT7CBSsQEeGSjxmsHoFRXU5PwHjbj");
	BadNodes.push_back("AVRXBRQh5iJPw4cjgNZ7LH97gHxyxaxnJv");
	BadNodes.push_back("AVt15fH21QcDkpkf75pmmoebenjhXu8om2");
	BadNodes.push_back("AVt1hffz3n3vLAFd5YF7X8iEx58GxJFim1");
	BadNodes.push_back("AVYdvRn58wNqW8JUSk1gugVda5D2iSRZGG");
	BadNodes.push_back("AVzPqbjRGYitxahoFwgj6VBNBWfYgUBdUy");
	BadNodes.push_back("AW4K2vE48phZcbuZ9LbJSpuGDosGrK6UXH");
	BadNodes.push_back("AWa5hjMvPjBgoc8Kivpuc4gZfqCjVexzFH");
	BadNodes.push_back("AWaLekM34R2sfV5tMa5j7SJnFAE6RHjk3d");
	BadNodes.push_back("AWecrxwNbskTSopQw91V5ybkVVHK6F4axP");
	BadNodes.push_back("AWF2UReo78ZsK8HuoeDhhFQZmWhrkLCA5y");
	BadNodes.push_back("AWfXPwUYuLYcLtjJEiTXe8L3Ffk2PfVMC6");
	BadNodes.push_back("AWRbrSw1t41YSQPMLjh3aaaDna8fW3VXUj");
	BadNodes.push_back("AWVvb1zCjfFCBVSMScTLJVubFmTXZxSXus");
	BadNodes.push_back("AX3bQwmuo6mDK8qtNJXPCciAgNcbU7vfqQ");
	BadNodes.push_back("AX4gK27amGhzkwJ1ufBi63BMNEBtaYCqs8");
	BadNodes.push_back("AX9rPK142J4YdreEbXWp939fCX3xxzSTK8");
	BadNodes.push_back("AXCVvFMqm8kBjZaEFjh6HqjrogSxo5iu4J");
	BadNodes.push_back("AXE41XcLVrkzpKE5S5L9ZFXAbvRHvTkZjC");
	BadNodes.push_back("AXfqTAptfVG6Szz5KnC13VB1giXxHUWz4k");
	BadNodes.push_back("AXG8pPkDWhxA1HNNEnfG5umWiJ3aDvUfpv");
	BadNodes.push_back("AXJW7yE8qZ3shEEFbtaDmbtgsxgWvP7dhN");
	BadNodes.push_back("AXmGZLTMnnmyEhaut6ynXUNR7y1b8HN7gh");
	BadNodes.push_back("AXmwZqJJG2iTi9YA8xH1M6jpuzJbP6ZSG8");
	BadNodes.push_back("AXRA3e5gwYkvVhUNmHJscpvvrrzrL5jMZY");
	BadNodes.push_back("AXTtN8bMRVKmtd7Ft39NTkNUd56v3VhPjv");
	BadNodes.push_back("AXuzGycTq567gfVFfDChUU3ZnGv1Mu3GDH");
	BadNodes.push_back("AXyUBv19Lb8fZN7vDbcK1ga35TiyncTGzE");
	BadNodes.push_back("AY9N2FDJ3YTiQFen5Cr5fcecUwyhehmERJ");
	BadNodes.push_back("AYbKUxJa3kyTgpvtKWzBcSxUEnKSUkY3FN");
	BadNodes.push_back("AYbXimKftwveeRGoweEcaCZHYSC9iZWUBK");
	BadNodes.push_back("AYJEjYeUnp2v8CLJq4nSZVdWL69ixUhaW1");
	BadNodes.push_back("AYkiEZuJXwUaKwyirNGbtqa5XMA3xcuBd7");
	BadNodes.push_back("AYnnqRb8zPnAzEgr4G1ppbDFsnmNUX2sA8");
	BadNodes.push_back("AYVP9PQzrTdU4h9v2pmRsXZCyVZKn3onGH");
	BadNodes.push_back("AYZPE24DsuQPb2YxWNnrxpSYQMGgAeRnMi");
	BadNodes.push_back("AYZZfKpopxvtwxENx68gKH3oZM7NbmeSRE");
	BadNodes.push_back("AZASSeJFzvrxWYotoiXucm7ruBUrRdV4n3");
	BadNodes.push_back("AZcFmwJAoDg2EJA1KjNk3NFMfn4ZnafpYm");
	BadNodes.push_back("AZdXqASf7C4iJY2YKnrMvP6xi94kpD4ZiL");
	BadNodes.push_back("AZGCZ7c1GrntN8udyNL8t2ed6dgNCYpuPP");
	BadNodes.push_back("AZJyMQYhstsr7p4BLde6SsrKpJ7NKMAhdx");
	BadNodes.push_back("AZoQSSvg2jcdD3Cdy6fMZFndbs33qT3Fo4");
	BadNodes.push_back("AZqFXJeDqGDkPnKFs6hnrLUGynqLzv6yVo");
	BadNodes.push_back("AZXLwnDyzDA1HvaVK3qJseopJQw43vmFa7");

	//If Bad node Return true
	if (std::find(BadNodes.begin(), BadNodes.end(), address) != BadNodes.end()) {
		return true || state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-scammer");;
	}

	//If Nothing else return False
	return false;
}*/

max_stars_repo_name: CryptoBackups/abet

max_issues_repo_name: CryptoBackups/abet

max_forks_repo_name: CryptoBackups/abet


text:
#ifndef Z_Z_SERIAL_IPP
#define Z_Z_SERIAL_IPP

// Ourselves:
#include <Z/Z.hpp>

// Third Party:
// - Boost:
#include <boost/serialization/nvp.hpp>

namespace z {

  template <class Archive>
  void Z::serialize(Archive & ar_, const unsigned int version_)
  {
    ar_ & boost::serialization::make_nvp("y", _y_);
    ar_ & boost::serialization::make_nvp("x", _x_);
    return;
  }

}

#endif // Z_Z_SERIAL_IPP

ext: hpp


text:
#include "serialization.h"

/// TODO: should only be aware of messages
#include "Item.hpp"
#include "italo_logger.h"
#include "service_node.h"

#include <boost/endian/conversion.hpp>
#include <boost/format.hpp>

using italo::storage::Item;

namespace italo {

template <typename T>
static T deserialize_integer(std::string::const_iterator& it) {

    const auto b1 = reinterpret_cast<const T&>(*it);
    it += sizeof(T);
    return boost::endian::little_to_native(b1);
}

template <typename T>
static void serialize_integer(std::string& buf, T a) {
    boost::endian::native_to_little_inplace(a);
    const auto p = reinterpret_cast<const char*>(&a);
    buf.insert(buf.size(), p, sizeof(T));
}

static void serialize(std::string& buf, const std::string& str) {

    buf.reserve(buf.size() + str.size() + 4);
    serialize_integer(buf, str.size());
    buf += str;
}

template <typename T>
void serialize_message(std::string& res, const T& msg) {

    /// TODO: use binary / base64 representation for pk
    res += msg.pub_key;
    serialize(res, msg.hash);
    serialize(res, msg.data);
    serialize_integer(res, msg.ttl);
    serialize_integer(res, msg.timestamp);
    serialize(res, msg.nonce);

    ITALO_LOG(trace, "serialized message: {}", msg.data);
}

template void serialize_message(std::string& res, const message_t& msg);
template void serialize_message(std::string& res, const Item& msg);

template <typename T>
std::vector<std::string> serialize_messages(const std::vector<T>& msgs) {

    std::vector<std::string> res;

    std::string buf;

    constexpr size_t BATCH_SIZE = 500000;

    for (const auto& msg : msgs) {
        serialize_message(buf, msg);
        if (buf.size() > BATCH_SIZE) {
            res.push_back(std::move(buf));
            buf.clear();
        }
    }

    if (!buf.empty()) {
        res.push_back(std::move(buf));
    }

    return res;
}

template std::vector<std::string>
serialize_messages(const std::vector<message_t>& msgs);

template std::vector<std::string>
serialize_messages(const std::vector<Item>& msgs);

struct string_view {

    std::string::const_iterator it;
    const std::string::const_iterator it_end;

    string_view(const std::string& data)
        : it(data.begin()), it_end(data.end()) {}

    size_t size() { return it_end - it; }

    bool empty() { return it_end <= it; }
};

static std::optional<std::string> deserialize_string(string_view& slice,
                                                     size_t len) {

    if (slice.size() < len) {
        return std::nullopt;
    }

    const auto res = std::string(slice.it, slice.it + len);
    slice.it += len;

    return res;
}

static std::optional<std::string> deserialize_string(string_view& slice) {

    if (slice.size() < sizeof(size_t))
        return std::nullopt;

    const auto len =
        deserialize_integer<size_t>(slice.it); // already increments `it`!

    return deserialize_string(slice, len);
}

static std::optional<uint64_t> deserialize_uint64(string_view& slice) {

    if (slice.size() < sizeof(uint64_t))
        return std::nullopt;

    const auto res = deserialize_integer<uint64_t>(slice.it);

    return res;
}

std::vector<message_t> deserialize_messages(const std::string& blob) {

    ITALO_LOG(trace, "=== Deserializing ===");

    std::vector<message_t> result;

    string_view slice{blob};

    while (!slice.empty()) {

        /// Deserialize PK
        auto pk = deserialize_string(slice, italo::get_user_pubkey_size());
        if (!pk) {
            ITALO_LOG(debug, "Could not deserialize pk");
            return {};
        }

        /// Deserialize Hash
        auto hash = deserialize_string(slice);
        if (!hash) {
            ITALO_LOG(debug, "Could not deserialize hash");
            return {};
        }

        /// Deserialize Data
        auto data = deserialize_string(slice);
        if (!data) {
            ITALO_LOG(debug, "Could not deserialize data");
            return {};
        }

        /// Deserialize TTL
        auto ttl = deserialize_uint64(slice);
        if (!ttl) {
            ITALO_LOG(debug, "Could not deserialize ttl");
            return {};
        }

        /// Deserialize Timestamp
        auto timestamp = deserialize_uint64(slice);
        if (!timestamp) {
            ITALO_LOG(debug, "Could not deserialize timestamp");
            return {};
        }

        /// Deserialize Nonce
        auto nonce = deserialize_string(slice);
        if (!nonce) {
            ITALO_LOG(debug, "Could not deserialize nonce");
            return {};
        }

        ITALO_LOG(trace, "Deserialized data: {}", *data);

        ITALO_LOG(trace, "pk: {}, msg: {}", *pk, *data);

        result.push_back({*pk, *data, *hash, *ttl, *timestamp, *nonce});
    }

    ITALO_LOG(trace, "=== END ===");

    return result;
}

} // namespace italo

ext: cpp


text: #include <boost/log/expressions/formatters/format.hpp>

max_stars_repo_name: miathedev/BoostForArduino

max_issues_repo_name: miathedev/BoostForArduino

max_forks_repo_name: miathedev/BoostForArduino


text:
//#include <something_that_defines_macros>

#if !defined(__clang__) \
    && !defined(__ICC) \
    && !defined(__INTEL_COMPILER) \
    && (defined(__GNUC__) || defined(__GNUG__))

// GCC specific

#endif

#include <boost/predef/compiler.h>

#if BOOST_COMP_GNUC

// GCC specific

#endif

#include <boost/predef/os.h>
#include <boost/predef/compiler.h>

#if BOOST_COMP_GNUC && BOOST_OS_LINUX && !BOOST_OS_ANDROID

// Do something for non Android Linux.

#endif

int main() {}

max_stars_repo_name: apolukhin/boost-cookbook

max_issues_repo_name: apolukhin/boost-cookbook

max_forks_repo_name: apolukhin/boost-cookbook


text:
#pragma once

#if defined(_OPENMP)
#include <omp.h>
#endif

#include <cmath>
#include <functional>
#include <map>
#include <vector>

#include <Eigen/Geometry>

namespace common_robotics_utilities
{
namespace math
{
///////////////////////////////////////////////////////////////
//// Typedefs for aligned STL containers using Eigen types ////
///////////////////////////////////////////////////////////////

using VectorVector2f
  = std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f>>;
using VectorVector2d
  = std::vector<Eigen::Vector2d, Eigen::aligned_allocator<Eigen::Vector2d>>;
using VectorVector3f
  = std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f>>;
using VectorVector3d
  = std::vector<Eigen::Vector3d, Eigen::aligned_allocator<Eigen::Vector3d>>;
using VectorVector4f
  = std::vector<Eigen::Vector4f, Eigen::aligned_allocator<Eigen::Vector4f>>;
using VectorVector4d
  = std::vector<Eigen::Vector4d, Eigen::aligned_allocator<Eigen::Vector4d>>;
using VectorQuaternionf
  = std::vector<Eigen::Quaternionf,
                Eigen::aligned_allocator<Eigen::Quaternionf>>;
using VectorQuaterniond
  = std::vector<Eigen::Quaterniond,
                Eigen::aligned_allocator<Eigen::Quaterniond>>;
using VectorIsometry3f
  = std::vector<Eigen::Isometry3f,
                Eigen::aligned_allocator<Eigen::Isometry3f>>;
using VectorIsometry3d
  = std::vector<Eigen::Isometry3d,
                Eigen::aligned_allocator<Eigen::Isometry3d>>;
using MapStringVector2f
  = std::map<std::string, Eigen::Vector2f, std::less<std::string>,
  Eigen::aligned_allocator<std::pair<const std::string, Eigen::Vector2f>>>;
using MapStringVector2d
  = std::map<std::string, Eigen::Vector2d, std::less<std::string>,
  Eigen::aligned_allocator<std::pair<const std::string, Eigen::Vector2d>>>;
using MapStringVector3f
  = std::map<std::string, Eigen::Vector3f, std::less<std::string>,
  Eigen::aligned_allocator<std::pair<const std::string, Eigen::Vector3f>>>;
using MapStringVector3d
  = std::map<std::string, Eigen::Vector3d, std::less<std::string>,
  Eigen::aligned_allocator<std::pair<const std::string, Eigen::Vector3d>>>;
using MapStringVector4f
  = std::map<std::string, Eigen::Vector4f, std::less<std::string>,
  Eigen::aligned_allocator<std::pair<const std::string, Eigen::Vector4f>>>;
using MapStringVector4d
  = std::map<std::string, Eigen::Vector4d, std::less<std::string>,
  Eigen::aligned_allocator<std::pair<const std::string, Eigen::Vector4d>>>;
using MapStringQuaternionf
  = std::map<std::string, Eigen::Quaternionf, std::less<std::string>,
  Eigen::aligned_allocator<std::pair<const std::string, Eigen::Quaternionf>>>;
using MapStringQuaterniond
  = std::map<std::string, Eigen::Quaterniond, std::less<std::string>,
  Eigen::aligned_allocator<std::pair<const std::string, Eigen::Quaterniond>>>;
using MapStringIsometry3f
  = std::map<std::string, Eigen::Isometry3f, std::less<std::string>,
  Eigen::aligned_allocator<std::pair<const std::string, Eigen::Isometry3f>>>;
using MapStringIsometry3d
  = std::map<std::string, Eigen::Isometry3d, std::less<std::string>,
  Eigen::aligned_allocator<std::pair<const std::string, Eigen::Isometry3d>>>;

bool Equal3d(const Eigen::Vector3d& v1, const Eigen::Vector3d& v2);

bool Equal4d(const Eigen::Vector4d& v1, const Eigen::Vector4d& v2);

bool CloseEnough(const double p1, const double p2, const double threshold);

bool CloseEnough(const Eigen::Vector3d& v1,
                 const Eigen::Vector3d& v2,
                 const double threshold);

Eigen::Vector3d RotateVector(const Eigen::Quaterniond& quat,
                             const Eigen::Vector3d& vec);

Eigen::Vector3d RotateVectorReverse(const Eigen::Quaterniond& quat,
                                    const Eigen::Vector3d& vec);

double EnforceContinuousRevoluteBounds(const double value);

Eigen::VectorXd SafeNormal(const Eigen::VectorXd& vec);

double SquaredNorm(const std::vector<double>& vec);

double Norm(const std::vector<double>& vec);

std::vector<double> Abs(const std::vector<double>& vec);

std::vector<double> Multiply(const std::vector<double>& vec,
                             const double scalar);

std::vector<double> Multiply(const std::vector<double>& vec1,
                             const std::vector<double>& vec2);

std::vector<double> Divide(const std::vector<double>& vec,
                           const double scalar);

std::vector<double> Divide(const std::vector<double>& vec1,
                           const std::vector<double>& vec2);

std::vector<double> Add(const std::vector<double>& vec,
                        const double scalar);

std::vector<double> Add(const std::vector<double>& vec1,
                        const std::vector<double>& vec2);

std::vector<double> Sub(const std::vector<double>& vec,
                        const double scalar);

std::vector<double> Sub(const std::vector<double>& vec1,
                        const std::vector<double>& vec2);

double Sum(const std::vector<double>& vec);

Eigen::Matrix3d Skew(const Eigen::Vector3d& vector);

Eigen::Vector3d Unskew(const Eigen::Matrix3d& matrix);

Eigen::Matrix4d TwistHat(const Eigen::Matrix<double, 6, 1>& twist);

Eigen::Matrix<double, 6, 1> TwistUnhat(const Eigen::Matrix4d& hatted_twist);

Eigen::Matrix<double, 6, 6> AdjointFromTransform(
    const Eigen::Isometry3d& transform);

Eigen::Matrix<double, 6, 1> TransformTwist(
    const Eigen::Isometry3d& transform,
    const Eigen::Matrix<double, 6, 1>& initial_twist);

Eigen::Matrix<double, 6, 1> TwistBetweenTransforms(
    const Eigen::Isometry3d& start,
    const Eigen::Isometry3d& end);

Eigen::Matrix3d ExpMatrixExact(const Eigen::Matrix3d& hatted_rot_velocity,
                               const double delta_t);

Eigen::Isometry3d ExpTwist(const Eigen::Matrix<double, 6, 1>& twist,
                           const double delta_t);

double Interpolate(const double p1, const double p2, const double ratio);

double InterpolateContinuousRevolute(const double p1,
                                     const double p2,
                                     const double ratio);

std::vector<double> Interpolate(const std::vector<double>& v1,
                                const std::vector<double>& v2,
                                const double ratio);

Eigen::Quaterniond Interpolate(const Eigen::Quaterniond& q1,
                               const Eigen::Quaterniond& q2,
                               const double ratio);

Eigen::VectorXd InterpolateXd(const Eigen::VectorXd& v1,
                              const Eigen::VectorXd& v2,
                              const double ratio);

Eigen::Vector3d Interpolate3d(const Eigen::Vector3d& v1,
                              const Eigen::Vector3d& v2,
                              const double ratio);

Eigen::Vector4d Interpolate4d(const Eigen::Vector4d& v1,
                              const Eigen::Vector4d& v2,
                              const double ratio);

Eigen::Isometry3d Interpolate(const Eigen::Isometry3d& t1,
                              const Eigen::Isometry3d& t2,
                              const double ratio);

double SquaredDistance(const Eigen::Vector2d& v1,
                       const Eigen::Vector2d& v2);

double Distance(const Eigen::Vector2d& v1,
                const Eigen::Vector2d& v2);

double SquaredDistance(const Eigen::Vector3d& v1,
                       const Eigen::Vector3d& v2);

double Distance(const Eigen::Vector3d& v1,
                const Eigen::Vector3d& v2);

double SquaredDistance(const Eigen::VectorXd& v1,
                       const Eigen::VectorXd& v2);

double Distance(const Eigen::VectorXd& v1,
                const Eigen::VectorXd& v2);

double Distance(const Eigen::Quaterniond& q1,
                const Eigen::Quaterniond& q2);

double Distance(const Eigen::Isometry3d& t1,
                const Eigen::Isometry3d& t2,
                const double alpha=0.5);

double SquaredDistance(const std::vector<double>& p1,
                       const std::vector<double>& p2);

double Distance(const std::vector<double>& p1, const std::vector<double>& p2);

double ContinuousRevoluteSignedDistance(const double p1, const double p2);

double ContinuousRevoluteDistance(const double p1, const double p2);

double AddContinuousRevoluteValues(const double start, const double change);

double GetContinuousRevoluteRange(const double start, const double end);

bool CheckInContinuousRevoluteRange(const double start,
                                    const double range,
                                    const double val);

bool CheckInContinuousRevoluteBounds(const double start,
                                     const double end,
                                     const double val);

double AverageStdVectorDouble(
    const std::vector<double>& values,
    const std::vector<double>& weights=std::vector<double>());

double ComputeStdDevStdVectorDouble(const std::vector<double>& values,
                                    const double mean);

double ComputeStdDevStdVectorDouble(const std::vector<double>& values);

double WeightedDotProduct(const Eigen::VectorXd& vec1,
                          const Eigen::VectorXd& vec2,
                          const Eigen::VectorXd& weights);

double WeightedSquaredNorm(const Eigen::VectorXd& vec,
                           const Eigen::VectorXd weights);

double WeightedNorm(const Eigen::VectorXd& vec,
                    const Eigen::VectorXd& weights);

double WeightedCosineAngleBetweenVectors(const Eigen::VectorXd& vec1,
                                         const Eigen::VectorXd& vec2,
                                         const Eigen::VectorXd& weights);

double WeightedAngleBetweenVectors(const Eigen::VectorXd& vec1,
                                   const Eigen::VectorXd& vec2,
                                   const Eigen::VectorXd& weights);

Eigen::Vector3d AverageEigenVector3d(
    const VectorVector3d& vectors,
    const std::vector<double>& weights=std::vector<double>());

Eigen::Vector4d AverageEigenVector4d(
    const VectorVector4d& vectors,
    const std::vector<double>& weights=std::vector<double>());

Eigen::VectorXd AverageEigenVectorXd(
    const std::vector<Eigen::VectorXd>& vectors,
    const std::vector<double>& weights=std::vector<double>());

Eigen::Quaterniond AverageEigenQuaterniond(
    const VectorQuaterniond& quaternions,
    const std::vector<double>& weights=std::vector<double>());

Eigen::Isometry3d AverageEigenIsometry3d(
    const VectorIsometry3d& transforms,
    const std::vector<double>& weights=std::vector<double>());

// This function does not actually deal with the continuous revolute
// space correctly, it just assumes a normal real Euclidean space
double AverageContinuousRevolute(
    const std::vector<double>& angles,
    const std::vector<double>& weights=std::vector<double>());

template <typename Derived>
inline Eigen::MatrixXd ClampNorm(
    const Eigen::MatrixBase<Derived>& item_to_clamp, const double max_norm)
{
  const double current_norm = item_to_clamp.norm();
  if (current_norm > max_norm)
  {
    return item_to_clamp * (max_norm / current_norm);
  }
  return item_to_clamp;
}

// This function is really only going to work well for "almost continuous"
// types, i.e. floats and doubles, due to the implementation
template<typename ScalarType, int Rows,
         typename Allocator=std::allocator<Eigen::Matrix<ScalarType, Rows, 1>>>
inline Eigen::Matrix<ScalarType, Rows, 1> AverageEigenVector(
    const std::vector<Eigen::Matrix<ScalarType, Rows, 1>, Allocator>& vectors,
    const std::vector<double>& weights = std::vector<double>())
{
  // Get the weights
  if (vectors.empty())
  {
    throw std::invalid_argument("vectors is empty");
  }
  if ((weights.size() > 0) && (vectors.size() != weights.size()))
  {
    throw std::invalid_argument("weights.size() > 0 != vectors.size()");
  }
  const bool use_weights = (weights.size() != 0);
  // Find the first element with non-zero weight
  size_t starting_idx = 0;
  while (starting_idx < weights.size() && weights[starting_idx] == 0.0)
  {
    starting_idx++;
  }
  // If all weights are zero, result is undefined
  if (starting_idx >= vectors.size())
  {
    throw std::invalid_argument("All provided weights are zero");
  }
  // Start the recursive definition with the base case
  Eigen::Matrix<ScalarType, Rows, 1> avg_vector = vectors[starting_idx];
  const double starting_weight = use_weights ? std::abs(weights[starting_idx])
                                             : 1.0;
  double weights_running_sum = starting_weight;
  // Do the weighted averaging on the rest of the vectors
  for (size_t idx = starting_idx + 1; idx < vectors.size(); ++idx)
  {
    const double weight = use_weights ? std::abs(weights[idx]) : 1.0;
    weights_running_sum += weight;
    const double effective_weight = weight / weights_running_sum;
    const Eigen::Matrix<ScalarType, Rows, 1> prev_avg_vector = avg_vector;
    const Eigen::Matrix<ScalarType, Rows, 1>& current = vectors[idx];
    avg_vector = prev_avg_vector
                 + (effective_weight * (current - prev_avg_vector));
  }
  return avg_vector;
}

// Projects vector_to_project onto base_vector and
// returns the portion that is parallel to base_vector
template <typename DerivedB, typename DerivedV>
inline Eigen::Matrix<typename DerivedB::Scalar, Eigen::Dynamic, 1>
VectorProjection(
    const Eigen::MatrixBase<DerivedB>& base_vector,
    const Eigen::MatrixBase<DerivedV>& vector_to_project)
{
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(DerivedB);
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(DerivedV);
  EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(DerivedB, DerivedV)
  static_assert(std::is_same<typename DerivedB::Scalar,
                typename DerivedV::Scalar>::value,
                "vectors must have the same data type");
  // Perform projection
  const typename DerivedB::Scalar b_squared_norm = base_vector.squaredNorm();
  if (b_squared_norm > 0)
  {
    return (base_vector.dot(vector_to_project) / b_squared_norm) * base_vector;
  }
  else
  {
    return Eigen::Matrix<typename DerivedB::Scalar, Eigen::Dynamic, 1>
        ::Zero(base_vector.rows());
  }
}

// Projects vector_to_project onto base_vector and
// returns the portion that is perpendicular to base_vector
template <typename DerivedB, typename DerivedV>
inline Eigen::Matrix<typename DerivedB::Scalar, Eigen::Dynamic, 1>
VectorRejection(
    const Eigen::MatrixBase<DerivedB>& base_vector,
    const Eigen::MatrixBase<DerivedV>& vector_to_reject)
{
  // Rejection is defined in relation to projection
  return vector_to_reject - VectorProjection(base_vector, vector_to_reject);
}

template <typename DerivedV>
inline Eigen::Matrix<typename DerivedV::Scalar, Eigen::Dynamic, 1>
GetArbitraryOrthogonalVector(const Eigen::MatrixBase<DerivedV>& vector)
{
  // We're going to try arbitrary possibilities until one of them works
  const ssize_t vector_size = vector.size();
  if (vector_size > 0)
  {
    for (ssize_t idx = 0; idx < vector_size; idx++)
    {
      Eigen::Matrix<typename DerivedV::Scalar, Eigen::Dynamic, 1> test_vector
          = Eigen::Matrix<typename DerivedV::Scalar, Eigen::Dynamic, 1>
          ::Zero(vector_size);
      test_vector(idx) = static_cast<typename DerivedV::Scalar>(1.0);
      const auto rejected_vector = VectorRejection(vector, test_vector);
      const typename DerivedV::Scalar rejected_vector_squared_norm
          = rejected_vector.squaredNorm();
      if (rejected_vector_squared_norm > 0)
      {
        return rejected_vector;
      }
    }
    throw std::runtime_error("Vector rejection failed to find orthogonal"
                             " vector, probably numerical error");
  }
  else
  {
    throw std::invalid_argument("Vector size is zero");
  }
}

template <typename DerivedV>
inline Eigen::Matrix<typename DerivedV::Scalar, Eigen::Dynamic, 1>
GetArbitraryOrthogonalVectorToPlane(
    const Eigen::MatrixBase<DerivedV>& plane_vector1,
    const Eigen::MatrixBase<DerivedV>& plane_vector2,
    const Eigen::MatrixBase<DerivedV>& vector)
{
  const ssize_t vector_size = vector.size();
  if ((vector_size > 0)
      && (vector_size == plane_vector1.size())
      && (vector_size == plane_vector2.size()))
  {
    const Eigen::MatrixBase<DerivedV> unit_plane_vector1
        = plane_vector1 / plane_vector1.norm();
    const Eigen::MatrixBase<DerivedV> unit_plane_vector2
        = plane_vector2 / plane_vector2.norm();
    const typename DerivedV::Scalar plane_vector_dot_product_mag
        = std::abs(unit_plane_vector1.dot(unit_plane_vector2));
    if (plane_vector_dot_product_mag == 1.0)
    {
      throw std::invalid_argument("Plane vectors do not define a valid plane");
    }
    else
    {
      // Try both plane vectors
      // (by definition, one of the two MUST have an orthogonal component!)
      const auto rejected_vector1 = VectorRejection(vector, plane_vector1);
      const typename DerivedV::Scalar rejected_vector1_squared_norm
          = rejected_vector1.squaredNorm();
      if (rejected_vector1_squared_norm > 0)
      {
        return rejected_vector1;
      }
      else
      {
        const auto rejected_vector2 = VectorRejection(vector, plane_vector2);
        const typename DerivedV::Scalar rejected_vector2_squared_norm
            = rejected_vector2.squaredNorm();
        if (rejected_vector2_squared_norm > 0)
        {
          return rejected_vector2;
        }
        else
        {
          throw std::runtime_error("Vector rejection failed to find orthogonal"
                                   " vector, probably numerical error");
        }
      }
    }
  }
  else
  {
    throw std::invalid_argument("Vector size is zero");
  }
}

template<typename DataType, typename Container=std::vector<DataType>>
Eigen::MatrixXd BuildPairwiseDistanceMatrixParallel(
    const Container& data,
    const std::function<double(const DataType&, const DataType&)>& distance_fn)
{
  Eigen::MatrixXd distance_matrix(data.size(), data.size());
#if defined(_OPENMP)
#pragma omp parallel for
#endif
  for (size_t idx = 0; idx < data.size(); idx++)
  {
    for (size_t jdx = idx; jdx < data.size(); jdx++)
    {
      if (idx != jdx)
      {
        const double distance = distance_fn(data[idx], data[jdx]);
        distance_matrix(static_cast<ssize_t>(idx), static_cast<ssize_t>(jdx))
            = distance;
        distance_matrix(static_cast<ssize_t>(jdx), static_cast<ssize_t>(idx))
            = distance;
      }
      else
      {
        distance_matrix(static_cast<ssize_t>(idx), static_cast<ssize_t>(jdx))
            = 0.0;
        distance_matrix(static_cast<ssize_t>(jdx), static_cast<ssize_t>(idx))
            = 0.0;
      }
    }
  }
  return distance_matrix;
}

template<typename DataType, typename Container=std::vector<DataType>>
Eigen::MatrixXd BuildPairwiseDistanceMatrixSerial(
    const Container& data,
    const std::function<double(const DataType&, const DataType&)>& distance_fn)
{
  Eigen::MatrixXd distance_matrix(data.size(), data.size());
  for (size_t idx = 0; idx < data.size(); idx++)
  {
    for (size_t jdx = idx; jdx < data.size(); jdx++)
    {
      if (idx != jdx)
      {
        const double distance = distance_fn(data[idx], data[jdx]);
        distance_matrix(static_cast<ssize_t>(idx), static_cast<ssize_t>(jdx))
            = distance;
        distance_matrix(static_cast<ssize_t>(jdx), static_cast<ssize_t>(idx))
            = distance;
      }
      else
      {
        distance_matrix(static_cast<ssize_t>(idx), static_cast<ssize_t>(jdx))
            = 0.0;
        distance_matrix(static_cast<ssize_t>(jdx), static_cast<ssize_t>(idx))
            = 0.0;
      }
    }
  }
  return distance_matrix;
}

template<typename DataType, typename Container=std::vector<DataType>>
Eigen::MatrixXd BuildPairwiseDistanceMatrix(
    const Container& data,
    const std::function<double(const DataType&, const DataType&)>& distance_fn,
    const bool use_parallel = false)
{
  if (use_parallel)
  {
    return BuildPairwiseDistanceMatrixParallel(data, distance_fn);
  }
  else
  {
    return BuildPairwiseDistanceMatrixSerial(data, distance_fn);
  }
}

template<typename FirstDataType, typename SecondDataType,
         typename FirstContainer=std::vector<FirstDataType>,
         typename SecondContainer=std::vector<SecondDataType>>
Eigen::MatrixXd BuildPairwiseDistanceMatrixParallel(
    const FirstContainer& data1, const SecondContainer& data2,
    const std::function<double(const FirstDataType&,
                               const SecondDataType&)>& distance_fn)
{
  Eigen::MatrixXd distance_matrix(data1.size(), data2.size());
#if defined(_OPENMP)
#pragma omp parallel for
#endif
  for (size_t idx = 0; idx < data1.size(); idx++)
  {
    for (size_t jdx = 0; jdx < data2.size(); jdx++)
    {
      const double distance = distance_fn(data1[idx], data2[jdx]);
      distance_matrix(static_cast<ssize_t>(idx), static_cast<ssize_t>(jdx))
          = distance;
    }
  }
  return distance_matrix;
}

template<typename FirstDataType, typename SecondDataType,
         typename FirstContainer=std::vector<FirstDataType>,
         typename SecondContainer=std::vector<SecondDataType>>
Eigen::MatrixXd BuildPairwiseDistanceMatrixSerial(
    const FirstContainer& data1, const SecondContainer& data2,
    const std::function<double(const FirstDataType&,
                               const SecondDataType&)>& distance_fn)
{
  Eigen::MatrixXd distance_matrix(data1.size(), data2.size());
  for (size_t idx = 0; idx < data1.size(); idx++)
  {
    for (size_t jdx = 0; jdx < data2.size(); jdx++)
    {
      const double distance = distance_fn(data1[idx], data2[jdx]);
      distance_matrix(static_cast<ssize_t>(idx), static_cast<ssize_t>(jdx))
          = distance;
    }
  }
  return distance_matrix;
}

template<typename FirstDataType, typename SecondDataType,
         typename FirstContainer=std::vector<FirstDataType>,
         typename SecondContainer=std::vector<SecondDataType>>
Eigen::MatrixXd BuildPairwiseDistanceMatrix(
    const FirstContainer& data1, const SecondContainer& data2,
    const std::function<double(const FirstDataType&,
                               const SecondDataType&)>& distance_fn,
    const bool use_parallel = false)
{
  if (use_parallel)
  {
    return BuildPairwiseDistanceMatrixParallel(data1, data2, distance_fn);
  }
  else
  {
    return BuildPairwiseDistanceMatrixSerial(data1, data2, distance_fn);
  }
}

class Hyperplane
{
private:
  Eigen::VectorXd plane_origin_;
  Eigen::VectorXd plane_normal_;

public:

  Hyperplane(const Eigen::VectorXd& origin, const Eigen::VectorXd& normal)
      : plane_origin_(origin), plane_normal_(normal)
  {
    if (plane_origin_.size() != plane_normal_.size())
    {
      throw std::invalid_argument("origin.size() != normal.size()");
    }
  }

  Hyperplane() {}

  size_t GetDimensionality() const
  {
    return static_cast<size_t>(plane_origin_.size());
  }

  const Eigen::VectorXd& GetOrigin() const { return plane_origin_; }

  const Eigen::VectorXd& GetNormal() const { return plane_normal_; }

  double GetNormedDotProduct(const Eigen::VectorXd& point) const
  {
    const Eigen::VectorXd check_vector = point - GetOrigin();
    const Eigen::VectorXd check_vector_normed = SafeNormal(check_vector);
    const double dot_product = check_vector_normed.dot(GetNormal());
    return dot_product;
  }

  double GetRawDotProduct(const Eigen::VectorXd& point) const
  {
    const Eigen::VectorXd check_vector = point - GetOrigin();
    const double dot_product = check_vector.dot(GetNormal());
    return dot_product;
  }

  Eigen::VectorXd RejectVectorOntoPlane(const Eigen::VectorXd& vector) const
  {
    return VectorProjection(GetNormal(), vector);
  }

  double GetSquaredDistanceToPlane(const Eigen::VectorXd& point) const
  {
    const Eigen::VectorXd origin_to_point_vector = point - GetOrigin();
    return VectorProjection(GetNormal(), origin_to_point_vector).squaredNorm();
  }

  double GetDistanceToPlane(const Eigen::VectorXd& point) const
  {
    const Eigen::VectorXd origin_to_point_vector = point - GetOrigin();
    return VectorProjection(GetNormal(), origin_to_point_vector).norm();
  }

  Eigen::VectorXd ProjectVectorOntoPlane(const Eigen::VectorXd& vector) const
  {
    return VectorRejection(GetNormal(), vector);
  }

  Eigen::VectorXd ProjectPointOntoPlane(const Eigen::VectorXd& point) const
  {
    const Eigen::VectorXd origin_to_point_vector = point - GetOrigin();
    const Eigen::VectorXd projected_to_point_vector =
        VectorRejection(GetNormal(), origin_to_point_vector);
    const Eigen::VectorXd projected_point =
        GetOrigin() + projected_to_point_vector;
    return projected_point;
  }
};

Hyperplane FitPlaneToPoints(const std::vector<Eigen::VectorXd>& points);
}  // namespace math
}  // namespace common_robotics_utilities


text: #include <boost/mpl/vector/aux_/preprocessed/typeof_based/vector20_c.hpp>


text:
/*=============================================================================
    Phoenix V1.2.1
    Copyright (c) 2001-2002 Joel de Guzman

    Use, modification and distribution is subject to the Boost Software
    License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
    http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_SPIRIT_PHOENIX_HPP)
#define BOOST_SPIRIT_PHOENIX_HPP

#include <boost/spirit/phoenix/tuples.hpp>
#include <boost/spirit/phoenix/tuple_helpers.hpp>
#include <boost/spirit/phoenix/actor.hpp>
#include <boost/spirit/phoenix/primitives.hpp>
#include <boost/spirit/phoenix/composite.hpp>
#include <boost/spirit/phoenix/functions.hpp>
#include <boost/spirit/phoenix/operators.hpp>
#include <boost/spirit/phoenix/special_ops.hpp>
#include <boost/spirit/phoenix/statements.hpp>
#include <boost/spirit/phoenix/binders.hpp>
#include <boost/spirit/phoenix/closures.hpp>
#include <boost/spirit/phoenix/casts.hpp>
#include <boost/spirit/phoenix/new.hpp>

#endif // !defined(BOOST_SPIRIT_PHOENIX_HPP)

max_stars_repo_name: schinmayee/nimbus

max_issues_repo_name: schinmayee/nimbus

max_forks_repo_name: schinmayee/nimbus


text:
#include <golos/plugins/operation_history/plugin.hpp>
#include <golos/plugins/operation_history/history_object.hpp>

#include <golos/plugins/json_rpc/api_helper.hpp>
#include <golos/protocol/exceptions.hpp>
#include <golos/chain/operation_notification.hpp>
#include <golos/api/operation_history_extender.hpp>

#include <boost/algorithm/string.hpp>

#define STEEM_NAMESPACE_PREFIX "golos::protocol::"
#define OPERATION_POSTFIX "_operation"

namespace golos { namespace plugins { namespace operation_history {

    struct operation_visitor_filter;

    using namespace golos::protocol;
    using namespace golos::chain;
    using golos::api::operation_history_extender;

    struct operation_visitor {
        operation_visitor(
            golos::chain::database& db,
            golos::chain::operation_notification& op_note,
            uint32_t start_block)
            : database(db),
              note(op_note),
              start_block(start_block) {
        }

        using result_type = void;

        golos::chain::database& database;
        golos::chain::operation_notification& note;
        uint32_t start_block;

        template<typename Op>
        void operator()(Op&&) const {
            if (start_block <= database.head_block_num()) {
                note.stored_in_db = true;

                operation opv;
                operation_history_extender extender(database, opv);
                bool extended = note.op.visit(extender);

                database.create<operation_object>([&](operation_object& obj) {
                    note.db_id = obj.id._id;

                    obj.trx_id = note.trx_id;
                    obj.block = note.block;
                    obj.trx_in_block = note.trx_in_block;
                    obj.op_in_trx = note.op_in_trx;
                    obj.virtual_op = note.virtual_op;
                    obj.timestamp = database.head_block_time();

                    size_t size = 0;
                    if (extended) {
                        size = fc::raw::pack_size(opv);
                    } else {
                        size = fc::raw::pack_size(note.op);
                    }
                    obj.serialized_op.resize(size);
                    fc::datastream<char*> ds(obj.serialized_op.data(), size);
                    if (extended) {
                        fc::raw::pack(ds, opv);
                    } else {
                        fc::raw::pack(ds, note.op);
                    }
                });
            }
        }

        // available only in event_plugin and account_history
        void operator()(const comment_mention_operation& op) {
        }

        // available only in event_plugin and account_history
        void operator()(const account_reputation_operation& op) {
        }

        // available only in event_plugin and account_history
        void operator()(const minus_reputation_operation& op) {
        }
    };

    struct operation_visitor_filter final : operation_visitor {

        operation_visitor_filter(
            golos::chain::database& db,
            golos::chain::operation_notification& note,
            const fc::flat_set<std::string>& ops_list,
            bool is_blacklist,
            uint32_t block)
            : operation_visitor(db, note, block),
              filter(ops_list),
              blacklist(is_blacklist),
              start_block(block) {
        }

        const fc::flat_set<std::string>& filter;
        bool blacklist;
        uint32_t start_block;

        template <typename T>
        void operator()(const T& op) const {
            if (filter.find(fc::get_typename<T>::name()) != filter.end()) {
                if (!blacklist) {
                    operation_visitor::operator()(op);
                }
            } else {
                if (blacklist) {
                   operation_visitor::operator()(op);
                }
            }
        }
    };

    struct plugin::plugin_impl final {
    public:
        plugin_impl(): database(appbase::app().get_plugin<chain::plugin>().db()) {
        }

        ~plugin_impl() = default;

        void erase_old_blocks() {
            uint32_t head_block = database.head_block_num();
            if (history_blocks <= head_block) {
                uint32_t need_block = head_block - history_blocks;
                const auto& idx = database.get_index<operation_index>().indices().get<by_location>();
                auto it = idx.begin();
                while (it != idx.end() && it->block <= need_block) {
                    auto next_it = it;
                    ++next_it;
                    database.remove(*it);
                    it = next_it;
                }
            }
        }

        void on_operation(golos::chain::operation_notification& note) {
            if (filter_content) {
                note.op.visit(operation_visitor_filter(database, note, ops_list, blacklist, start_block));
            } else {
                note.op.visit(operation_visitor(database, note, start_block));
            }
        }

        annotated_signed_block get_block_with_virtual_ops(uint32_t block_num) {

            annotated_signed_block result;

            auto sb = database.fetch_block_by_number(block_num);
            if (!sb.valid()) {
                return result;
            }
            result = annotated_signed_block(*sb);

            const auto& idx = database.get_index<operation_index>().indices().get<by_location>();
            auto itr = idx.lower_bound(block_num);
            result._virtual_operations = block_operations();
            for (; itr != idx.end() && itr->block == block_num; ++itr) {
                if (itr->virtual_op != 0) {
                    block_operation op;
                    op.trx_in_block = itr->trx_in_block;
                    op.op_in_trx = itr->op_in_trx;
                    op.virtual_op = itr->virtual_op;
                    op.op = fc::raw::unpack<protocol::operation>(itr->serialized_op);
                    (*result._virtual_operations).push_back(op);
                }
            }

            return result;
        }

        std::vector<applied_operation> get_ops_in_block(
            uint32_t block_num,
            bool only_virtual
        ) {
            const auto& idx = database.get_index<operation_index>().indices().get<by_location>();
            auto itr = idx.lower_bound(block_num);
            std::vector<applied_operation> result;
            for (; itr != idx.end() && itr->block == block_num; ++itr) {
                applied_operation operation(*itr);
                if (!only_virtual || operation.virtual_op != 0) {
                    result.push_back(std::move(operation));
                }
            }
            return result;
        }

        annotated_signed_transaction get_transaction(transaction_id_type id) {
            const auto &idx = database.get_index<operation_index>().indices().get<by_transaction_id>();
            auto itr = idx.lower_bound(id);
            if (itr != idx.end() && itr->trx_id == id) {
                auto blk = database.fetch_block_by_number(itr->block);
                FC_ASSERT(blk.valid());
                FC_ASSERT(blk->transactions.size() > itr->trx_in_block);
                annotated_signed_transaction result = blk->transactions[itr->trx_in_block];
                result.block_num = itr->block;
                result.transaction_num = itr->trx_in_block;
                return result;
            }
            GOLOS_THROW_MISSING_OBJECT("transaction", id);
        }

        bool filter_content = false;
        uint32_t start_block = 0;
        uint32_t history_blocks = UINT32_MAX;
        bool blacklist = true;
        fc::flat_set<std::string> ops_list;
        golos::chain::database& database;
    };

    DEFINE_API(plugin, get_block_with_virtual_ops) {
        PLUGIN_API_VALIDATE_ARGS(
            (uint32_t, block_num)
        );
        return pimpl->database.with_weak_read_lock([&](){
            return pimpl->get_block_with_virtual_ops(block_num);
        });
    }

    DEFINE_API(plugin, get_ops_in_block) {
        PLUGIN_API_VALIDATE_ARGS(
            (uint32_t, block_num)
            (bool,     only_virtual)
        );
        return pimpl->database.with_weak_read_lock([&](){
            return pimpl->get_ops_in_block(block_num, only_virtual);
        });
    }

    DEFINE_API(plugin, get_transaction) {
        PLUGIN_API_VALIDATE_ARGS(
            (transaction_id_type, id)
        );
        return pimpl->database.with_weak_read_lock([&](){
            return pimpl->get_transaction(id);
        });
    }

    void plugin::set_program_options(
        boost::program_options::options_description& cli,
        boost::program_options::options_description& cfg
    ) {
        cfg.add_options() (
            "history-whitelist-ops",
            boost::program_options::value<std::vector<std::string>>()->composing(),
            "Defines a list of operations which will be explicitly logged."
        ) (
            "history-blacklist-ops",
            boost::program_options::value<std::vector<std::string>>()->composing(),
            "Defines a list of operations which will be explicitly ignored."
        ) (
            "history-start-block",
            boost::program_options::value<uint32_t>(),
            "Defines starting block from which recording stats."
        ) (
            "history-blocks",
            boost::program_options::value<uint32_t>(),
            "Defines depth of history for recording stats."
        );
    }

    void plugin::plugin_initialize(const boost::program_options::variables_map& options) {
        ilog("operation_history plugin: plugin_initialize() begin");

        pimpl = std::make_unique<plugin_impl>();

        pimpl->database.pre_apply_operation.connect([&](golos::chain::operation_notification& note){
            pimpl->on_operation(note);
        });

        golos::chain::add_plugin_index<operation_index>(pimpl->database);

        auto split_list = [&](const std::vector<std::string>& ops_list) {
            for (const auto& raw: ops_list) {
                std::vector<std::string> ops;
                boost::split(ops, raw, boost::is_any_of(" \t,"));

                for (const auto& op : ops) {
                    if (op.size()) {
                        std::size_t pos = op.find(OPERATION_POSTFIX);
                        if (pos not_eq std::string::npos and (pos + strlen(OPERATION_POSTFIX)) == op.size()) {
                            pimpl->ops_list.insert(STEEM_NAMESPACE_PREFIX + op);
                        } else {
                            pimpl->ops_list.insert(STEEM_NAMESPACE_PREFIX + op + OPERATION_POSTFIX);
                        }
                    }
                }
            }
        };

        if (options.count("history-whitelist-ops")) {
            GOLOS_CHECK_OPTION(!options.count("history-blacklist-ops"),
                "history-blacklist-ops and history-whitelist-ops can't be specified together");

            pimpl->filter_content = true;
            pimpl->blacklist = false;
            split_list(options.at("history-whitelist-ops").as<std::vector<std::string>>());
            ilog("operation_history: whitelisting ops ${o}", ("o", pimpl->ops_list));
        } else if (options.count("history-blacklist-ops")) {
            pimpl->filter_content = true;
            pimpl->blacklist = true;
            split_list(options.at("history-blacklist-ops").as<std::vector<std::string>>());
            ilog("operation_history: blacklisting ops ${o}", ("o", pimpl->ops_list));
        }

        if (options.count("history-start-block")) {
            pimpl->filter_content = true;
            pimpl->start_block = options.at("history-start-block").as<uint32_t>();
        } else {
            pimpl->start_block = 0;
        }
        ilog("operation_history: start_block ${s}", ("s", pimpl->start_block));

        if (options.count("history-blocks")) {
            uint32_t history_blocks = options.at("history-blocks").as<uint32_t>();
            pimpl->history_blocks = history_blocks;
            pimpl->database.applied_block.connect([&](const signed_block& block){
                pimpl->erase_old_blocks();
            });
        } else {
            pimpl->history_blocks = UINT32_MAX;
        }
        ilog("operation_history: history-blocks ${s}", ("s", pimpl->history_blocks));

        JSON_RPC_REGISTER_API(name());
        ilog("operation_history plugin: plugin_initialize() end");
    }

    plugin::plugin() = default;

    plugin::~plugin() = default;

    const std::string& plugin::name() {
        static std::string name = "operation_history";
        return name;
    }

    void plugin::plugin_startup() {
        ilog("operation_history plugin: plugin_startup() begin");
        ilog("operation_history plugin: plugin_startup() end");
    }

    void plugin::plugin_shutdown() {
    }

} } } // golos::plugins::operation_history

max_stars_repo_name: golos-classic/golos

max_issues_repo_name: golos-classic/golos

max_forks_repo_name: golos-classic/golos