void ApplyTestnetParameters(void) { COIN_PORT = 8742; RPC_PORT = 8743; std::memcpy(PROTOCOL_MAGIC_BYTES, &TESTNET_PROTOCOL_MAGIC_BYTES, sizeof(PROTOCOL_MAGIC_BYTES)); AUTO_DNS_SEEDS = TESTNET_AUTO_DNS_SEEDS; AUTO_IP_SEEDS = TESTNET_AUTO_IP_SEEDS; PUBKEY_ADDRESS_PREFIX = 65; // 'T' PRVKEY_ADDRESS_PREFIX = 68; // 'U' SCRIPT_ADDRESS_PREFIX = 127; // 't' GENESIS_MERKLE_HASH = hash_t("79f80fcf39b37d4403066ee16f33d7e2349a641c905b48fcbcc2533d33e0bda6"); GENESIS_HASH = hash_t("00148aaab24ed309efad7f9ceab687c3dd568e962a7c0fe4aed825da97877c56"); GENESIS_IDENT = "And I moved upon the face of the darkness. And I saw that I was alone. Let there be light."; GENESIS_TX_TIME = 1345084287; GENESIS_BLOCK_TIME = 1345084287; GENESIS_BLOCK_NONCE = 2179984344; GENESIS_BLOCK_VERSION = 1; STAKE_MODIFIER_CHECKPOINTS = boost::assign::map_list_of(0, 0xfd11f4e7); POW_MAX_BLOCK = std::numeric_limits< blockheight_t >::max(); COIN_PREMINE = 1000000 * COIN; POW_INITIAL_TARGET = target_t(~uint256(0) >> 10); POS_INITIAL_TARGET = target_t(~uint256(0) >> 10); POW_MAX_TARGET = target_t(~uint256(0) >> 10); POS_MAX_TARGET = target_t(~uint256(0) >> 10); TARGET_SPACING = 10 * SECOND; //POW_BLOCK_REWARD = 1 * COIN; POW_DUMMY_BLOCK_COUNT = 0; STAKE_MIN_AGE = 138240 * SECOND / 2; STAKE_MAX_AGE = 138240 * SECOND / 2; MODIFIER_INTERVAL_BASE = 200 * MINUTE / 2; TARGET_TIMESPAN = 1 * HOUR ; BLOCK_CHECKPOINTS = boost::assign::map_list_of(0, GENESIS_HASH); COINBASE_MATURITY = 10; }
bool isAnagram(string s, string t) { vector<int> hash_s (26,0); vector<int> hash_t (26,0); hash_s = updateHashTable(s, hash_s); hash_t = updateHashTable(t, hash_t); int i; for(i=0;i<26;i++){ if(hash_s[i]!=hash_t[i]) return false; } return true; }
{ 0, 0 } }; static uint32_t MAINNET_AUTO_IP_SEEDS[] = { 0xC0A82ADC, 0xC0A82ADD, 0 }; char const * (*AUTO_DNS_SEEDS)[2] = MAINNET_AUTO_DNS_SEEDS; uint32_t (*AUTO_IP_SEEDS) = MAINNET_AUTO_IP_SEEDS; // These numbers map in a very convoluted way to the first character of the address. Found by trial and error. uint8_t PUBKEY_ADDRESS_PREFIX = 34; // "E" uint8_t PRVKEY_ADDRESS_PREFIX = 95; uint8_t SCRIPT_ADDRESS_PREFIX = 35; // "F" uint8_t PROPOSAL_ADDRESS_PREFIX = 24; // "p" (note, this is no capital 'P', you get N through Q) // The following constants define the genesis block of the coin network // If you change them, the hash will probably be wrong and the genesis invalid (because its hash would be higher than the initial target), and the client will try to generate a new valid genesis at startup hash_t GENESIS_MERKLE_HASH = hash_t("d5ab3e370e4a314b31784c05e184d87809646d06066d13a805ca9607eb5f08f0"); hash_t GENESIS_HASH = hash_t("003fd1bc80732e49c38247bb47afcaf8b7c9f427a9b69ad5bfd7c0402fcd4d56"); char const * GENESIS_IDENT = "And I moved upon the face of the darkness. And I saw that I was alone. Let there be light."; timestamp_t GENESIS_TX_TIME = 1345084287; timestamp_t GENESIS_BLOCK_TIME = 1345084287; uint32_t GENESIS_BLOCK_NONCE = 2179983835; uint32_t GENESIS_BLOCK_VERSION = 1; hash_t NULL_PROPOSAL_TXN_HASH = hash_t("486471692b7748edcce4935766dfe2bf7edf65fd8cb9912cd157bcd5364a1c2d"); std::map<blockheight_t, hash_t> BLOCK_CHECKPOINTS = boost::assign::map_list_of(0, GENESIS_HASH); std::map<blockheight_t, uint32_t> STAKE_MODIFIER_CHECKPOINTS = boost::assign::map_list_of(0, 0x0e00670b); // The maturity is the number of block required for a coinbase/coinstake transaction to be confirmed by the network (excluding the block which embeds the transaction)
hash_t device::hash() const { if (dHandle) { return dHandle->versionedHash(); } return hash_t(); }