CurrencyBuilder::CurrencyBuilder() { maxBlockNumber(parameters::CRYPTONOTE_MAX_BLOCK_NUMBER); maxBlockBlobSize(parameters::CRYPTONOTE_MAX_BLOCK_BLOB_SIZE); maxTxSize(parameters::CRYPTONOTE_MAX_TX_SIZE); publicAddressBase58Prefix(parameters::CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX); minedMoneyUnlockWindow(parameters::CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW); timestampCheckWindow(parameters::BLOCKCHAIN_TIMESTAMP_CHECK_WINDOW); blockFutureTimeLimit(parameters::CRYPTONOTE_BLOCK_FUTURE_TIME_LIMIT); moneySupply(parameters::MONEY_SUPPLY); emissionSpeedFactor(parameters::EMISSION_SPEED_FACTOR); rewardBlocksWindow(parameters::CRYPTONOTE_REWARD_BLOCKS_WINDOW); blockGrantedFullRewardZone(parameters::CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE); minerTxBlobReservedSize(parameters::CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE); numberOfDecimalPlaces(parameters::CRYPTONOTE_DISPLAY_DECIMAL_POINT); mininumFee(parameters::MINIMUM_FEE); defaultDustThreshold(parameters::DEFAULT_DUST_THRESHOLD); difficultyTarget(parameters::DIFFICULTY_TARGET); difficultyWindow(parameters::DIFFICULTY_WINDOW); difficultyLag(parameters::DIFFICULTY_LAG); difficultyCut(parameters::DIFFICULTY_CUT); maxBlockSizeInitial(parameters::MAX_BLOCK_SIZE_INITIAL); maxBlockSizeGrowthSpeedNumerator(parameters::MAX_BLOCK_SIZE_GROWTH_SPEED_NUMERATOR); maxBlockSizeGrowthSpeedDenominator(parameters::MAX_BLOCK_SIZE_GROWTH_SPEED_DENOMINATOR); lockedTxAllowedDeltaSeconds(parameters::CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS); lockedTxAllowedDeltaBlocks(parameters::CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS); mempoolTxLiveTime(parameters::CRYPTONOTE_MEMPOOL_TX_LIVETIME); mempoolTxFromAltBlockLiveTime(parameters::CRYPTONOTE_MEMPOOL_TX_FROM_ALT_BLOCK_LIVETIME); blocksFileName(parameters::CRYPTONOTE_BLOCKS_FILENAME); blocksCacheFileName(parameters::CRYPTONOTE_BLOCKSCACHE_FILENAME); blockIndexesFileName(parameters::CRYPTONOTE_BLOCKINDEXES_FILENAME); txPoolFileName(parameters::CRYPTONOTE_POOLDATA_FILENAME); testnet(false); }
Int_t KVINDRAOnlineDataAnalyser::TestPorts(Int_t p) { // Test ports for availability. Start from 'port' and go up to port+2000 at most. // Returns -1 if no ports available. GNetClientRoot testnet((char*) "localhost"); Int_t ret; ret = p; for (int i = 0; i < 2000; i++) { ret = testnet.TestPortFree(p, (char*) "localhost"); if (ret > 0) break; if ((ret <= 0)) p++; } return ret; }
const QByteArray Helpers::createBackup(const QDir& keystore) { const QByteArray settingsData = exportSettings(); const QByteArray addressData = exportAddresses(keystore); QByteArray testnetData; QDir testnet(keystore); // can't use && because C++ doesn't enforce execution order AFAIK if ( testnet.cd("../testnet") ) { if ( testnet.cd("keystore") ) { testnetData = exportAddresses(testnet); } } QByteArray all; // all without checksum QByteArray result; // full result with 16bit checksum QDataStream allStream(&all, QIODevice::WriteOnly); QDataStream resultStream(&result, QIODevice::WriteOnly); quint32 segmentSize; segmentSize = settingsData.size(); allStream << segmentSize; allStream << settingsData; segmentSize = addressData.size(); allStream << segmentSize; allStream << addressData; // add testnet addresses if present if ( testnetData.size() > 0 ) { segmentSize = testnetData.size(); allStream << segmentSize; allStream << testnetData; } quint32 allSize = all.size(); quint16 crc = qChecksum(all.data(), all.size()); resultStream << allSize; resultStream << crc; resultStream << all; return qCompress(result, 9); }
CurrencyBuilder::CurrencyBuilder(Logging::ILogger& log) : m_currency(log) { cryptonoteName(CRYPTONOTE_NAME); maxBlockNumber(parameters::CRYPTONOTE_MAX_BLOCK_NUMBER); maxBlockBlobSize(parameters::CRYPTONOTE_MAX_BLOCK_BLOB_SIZE); maxTxSize(parameters::CRYPTONOTE_MAX_TX_SIZE); publicAddressBase58Prefix(parameters::CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX); minedMoneyUnlockWindow(parameters::CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW); timestampCheckWindow(parameters::BLOCKCHAIN_TIMESTAMP_CHECK_WINDOW); blockFutureTimeLimit(parameters::CRYPTONOTE_BLOCK_FUTURE_TIME_LIMIT); moneySupply(parameters::MONEY_SUPPLY); // genesisBlockReward(parameters::GENESIS_BLOCK_REWARD); rewardBlocksWindow(parameters::CRYPTONOTE_REWARD_BLOCKS_WINDOW); blockGrantedFullRewardZone(parameters::CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE); minerTxBlobReservedSize(parameters::CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE); numberOfDecimalPlaces(parameters::CRYPTONOTE_DISPLAY_DECIMAL_POINT); mininumFee(parameters::MINIMUM_FEE); defaultDustThreshold(parameters::DEFAULT_DUST_THRESHOLD); difficultyTarget(parameters::DIFFICULTY_TARGET); difficultyWindow(parameters::DIFFICULTY_WINDOW); difficultyLag(parameters::DIFFICULTY_LAG); difficultyCut(parameters::DIFFICULTY_CUT); depositMinAmount(parameters::DEPOSIT_MIN_AMOUNT); depositMinTerm(parameters::DEPOSIT_MIN_TERM); depositMaxTerm(parameters::DEPOSIT_MAX_TERM); depositMinTotalRateFactor(parameters::DEPOSIT_MIN_TOTAL_RATE_FACTOR); depositMaxTotalRate(parameters::DEPOSIT_MAX_TOTAL_RATE); maxBlockSizeInitial(parameters::MAX_BLOCK_SIZE_INITIAL); maxBlockSizeGrowthSpeedNumerator(parameters::MAX_BLOCK_SIZE_GROWTH_SPEED_NUMERATOR); maxBlockSizeGrowthSpeedDenominator(parameters::MAX_BLOCK_SIZE_GROWTH_SPEED_DENOMINATOR); lockedTxAllowedDeltaSeconds(parameters::CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS); lockedTxAllowedDeltaBlocks(parameters::CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS); mempoolTxLiveTime(parameters::CRYPTONOTE_MEMPOOL_TX_LIVETIME); mempoolTxFromAltBlockLiveTime(parameters::CRYPTONOTE_MEMPOOL_TX_FROM_ALT_BLOCK_LIVETIME); numberOfPeriodsToForgetTxDeletedFromPool(parameters::CRYPTONOTE_NUMBER_OF_PERIODS_TO_FORGET_TX_DELETED_FROM_POOL); upgradeHeight(parameters::UPGRADE_HEIGHT); upgradeVotingThreshold(parameters::UPGRADE_VOTING_THRESHOLD); upgradeVotingWindow(parameters::UPGRADE_VOTING_WINDOW); upgradeWindow(parameters::UPGRADE_WINDOW); fusionTxMaxSize(parameters::FUSION_TX_MAX_SIZE); fusionTxMinInputCount(parameters::FUSION_TX_MIN_INPUT_COUNT); fusionTxMinInOutCountRatio(parameters::FUSION_TX_MIN_IN_OUT_COUNT_RATIO); blocksFileName(parameters::CRYPTONOTE_BLOCKS_FILENAME); blocksCacheFileName(parameters::CRYPTONOTE_BLOCKSCACHE_FILENAME); blockIndexesFileName(parameters::CRYPTONOTE_BLOCKINDEXES_FILENAME); txPoolFileName(parameters::CRYPTONOTE_POOLDATA_FILENAME); blockchinIndicesFileName(parameters::CRYPTONOTE_BLOCKCHAIN_INDICES_FILENAME); testnet(false); }