Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5d6a603
Fix croscompile for win32
2a5A1Ghu1 Feb 13, 2019
12b7514
Update Segwit and Zerocoin (#47)
Jun 24, 2019
7d5666f
Fix Spork Typo
2a5A1Ghu1 Jun 24, 2019
42e4e3b
Develop (#48)
Jun 24, 2019
753b407
Update README.md
Jun 27, 2019
1505c7f
Fixes issues when building in 10.15
Jan 28, 2020
262079c
Qt Frontend Performace
Jun 10, 2020
deff0fe
Added Qt Dependencies for Cross Compile
Jun 11, 2020
c4e3cf7
Update spork.h
Jun 13, 2020
a9034a7
[Qt][Bug] Load the most recent instead of the first transactions
Jun 13, 2020
9b06315
Fix QT and Boost bugs
Jun 13, 2020
f7c60b7
Update Seeders
Jun 13, 2020
bc85909
Update Budget and Regtest
Jun 14, 2020
143c9f5
More Budget and Regtest
Jun 14, 2020
e031358
Too Expressive
Jun 14, 2020
4fed6eb
Added select coin strategy
Jun 14, 2020
02716d2
allow openssl1.0/1.1 to coexist
Jun 15, 2020
95ab6e4
Prevent RPC calls during warmup
Jun 16, 2020
113aeea
Changed for loop copies to references, and added stake logging
Jun 16, 2020
4636021
Fixed masternode edit deleting two masternodes in list
Jun 16, 2020
7f7e8b7
Fix staking assertion
Jun 16, 2020
d332065
Added Python test for transaction too large issue
Jun 16, 2020
2ea230a
Added benchmark in mutex lock
Jun 16, 2020
2f242b0
Fix bugs in mnemonic selection and mint maturity
Jun 16, 2020
37076d4
Revert "Fix bugs in mnemonic selection and mint maturity"
Jun 17, 2020
a3e5bab
Replaced mapNextTx with smaller map to reduce memory usage.
Jun 18, 2020
a066075
Move ThreadStakeMinter out of net.cpp
Jun 19, 2020
7d640e4
Revert "Changed for loop copies to references, and added stake logging"
Jun 21, 2020
d51c034
Merge pull request #51 from theohmproject/develop-nostake-fix
squidicuzz Jun 21, 2020
a695e1a
Add missing QPainterPath include
2a5A1Ghu1 Jul 20, 2020
4ad3bcc
Lighter Icons
Aug 10, 2020
b872439
Update Checkpoints
Aug 10, 2020
9fc2b72
Switch Sporks
Aug 11, 2020
53655e5
Update Placeholder Address
Aug 11, 2020
12f5356
Ohmify
Aug 11, 2020
603929e
Merge Block Changes (#56)
2a5A1Ghu1 Sep 2, 2020
8320053
Merge branch 'master' into develop
2a5A1Ghu1 Sep 2, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4

[Makefile]
indent_style = tab
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 3)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_REVISION, 2)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2019)
define(_COPYRIGHT_YEAR, 2020)
AC_INIT([Ohmcoin Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[www.ohmcoin.io],[ohmcoin])
AC_CONFIG_SRCDIR([src/main.cpp])
AC_CONFIG_HEADERS([src/config/ohmcoin-config.h])
Expand Down
5 changes: 5 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ BITCOIN_CORE_H = \
compat/sanity.h \
consensus/merkle.h \
consensus/validation.h \
consensus/params.h \
consensus/upgrades.h \
compressor.h \
primitives/block.h \
primitives/deterministicmint.h \
Expand Down Expand Up @@ -219,6 +221,8 @@ libbitcoin_server_a_SOURCES = \
checkpoints.cpp \
httprpc.cpp \
httpserver.cpp \
consensus/params.cpp \
consensus/upgrades.cpp \
init.cpp \
leveldbwrapper.cpp \
main.cpp \
Expand Down Expand Up @@ -364,6 +368,7 @@ libbitcoin_common_a_SOURCES = \
coins.cpp \
compressor.cpp \
consensus/merkle.cpp \
consensus/upgrades.cpp \
primitives/block.cpp \
primitives/deterministicmint.cpp \
primitives/transaction.cpp \
Expand Down
96 changes: 82 additions & 14 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ void scrypt_1024_1_1_256_sp_generic(const char *input, char *output, char *scrat

for (k = 0; k < 32; k++)
le32enc(&B[4 * k], X[k]);

PBKDF2_SHA256((const uint8_t *)input, 80, B, 128, 1, (uint8_t *)output, 32);
}

Expand Down Expand Up @@ -393,15 +393,24 @@ class CMainParams : public CChainParams
nDefaultPort = 52020;
bnProofOfWorkLimit = ~uint256(0) >> 20;
nMaxReorganizationDepth = 100;
nEnforceBlockUpgradeMajority = 750;
nRejectBlockOutdatedMajority = 950;
nToCheckBlockUpgradeMajority = 1000;
nEnforceBlockUpgradeMajority = 2250;
nRejectBlockOutdatedMajority = 2850;
nToCheckBlockUpgradeMajority = 3000; // 24 hours (legacy)
nMinerThreads = 0;
nTargetTimespan = 1 * 30; // OHMC: 30 Seconds
nTargetSpacing = 1 * 30; // OHMC: 30 Seconds
nMaturity = 4;
nKarmanodeCountDrift = 20;
nMaxMoneyOut = 30000000 * COIN;
/* Legacy Blocktime */
nTargetTimespanLegacy = 1 * 60 * 40; // OHMC: 40 Minutes
nTargetSpacingLegacy = 1 * 30; // OHMC: 30 Seconds
/* New Blocktime */
nTargetTimespan = 1 * 60 * 60 * 2; // OHMC New: 120 Minutes
nTargetSpacing = 1 * 60 * 4; // OHMC New: 240 Seconds

/** Height or Time Based Activations **/
nLastPOWBlock = 1001;

nModifierUpdateBlock = 615800;

/** Height or Time Based Activations **/
nLastPOWBlock = 1001;
Expand Down Expand Up @@ -478,15 +487,30 @@ class CMainParams : public CChainParams
"31438167899885040445364023527381951378636564391212010397122822120720357";


nZerocoinStartHeight = 999999999;
nZerocoinLastOldParams = 99999999; // Updated to defer zerocoin v2 for further testing.

nMaxZerocoinSpendsPerTransaction = 7; // Assume about 20kb each
nMinZerocoinMintFee = 1 * CENT; //high fee required for zerocoin mints
nMintRequiredConfirmations = 20; //the maximum amount of confirmations until accumulated in 19
nRequiredAccumulation = 1;
nDefaultSecurityLevel = 100; //full security level for accumulators
nZerocoinHeaderVersion = 6; //Block headers must be this version once zerocoin is active
nZerocoinHeaderVersion = 99; //Block headers must be this version once zerocoin is active
nBudgetFeeConfirmations = 3; // Number of confirmations for the finalization fee

// Network upgrades
consensus.vUpgrades[Consensus::BASE_NETWORK].nActivationHeight =
Consensus::NetworkUpgrade::ALWAYS_ACTIVE;
consensus.vUpgrades[Consensus::UPGRADE_TESTDUMMY].nActivationHeight =
Consensus::NetworkUpgrade::NO_ACTIVATION_HEIGHT;
consensus.vUpgrades[Consensus::UPGRADE_V3_0_BLOCKTIME].nActivationHeight = 2977924;
consensus.vUpgrades[Consensus::UPGRADE_V3_0_BLOCKTIME].nProtocolVersion = 71020;
consensus.vUpgrades[Consensus::UPGRADE_V3_0_BLOCKREWARD].nActivationHeight = 2977924;
consensus.vUpgrades[Consensus::UPGRADE_V3_0_BLOCKREWARD].nProtocolVersion = 71020;
consensus.vUpgrades[Consensus::UPGRADE_V3_1_DUMMY].nActivationHeight =
Consensus::NetworkUpgrade::NO_ACTIVATION_HEIGHT;
consensus.vUpgrades[Consensus::UPGRADE_V3_2_DUMMY].nActivationHeight =
Consensus::NetworkUpgrade::NO_ACTIVATION_HEIGHT;
}

const Checkpoints::CCheckpointData& Checkpoints() const
Expand Down Expand Up @@ -516,20 +540,24 @@ class CTestNetParams : public CMainParams
nRejectBlockOutdatedMajority = 75;
nToCheckBlockUpgradeMajority = 100;
nMinerThreads = 0;
nTargetTimespan = 1 * 60; // Ohmcoin: 1 day
nTargetSpacing = 1 * 10; // Ohmcoin: 1 minute
/* Legacy Blocktime */
nTargetTimespanLegacy = 1 * 60 * 40; // OHMC: 40 Minutes
nTargetSpacingLegacy = 1 * 22; // OHMC: 22 Seconds
/* New Blocktime */
nTargetTimespan = 1 * 60 * 60 * 1; // OHMC New: 60 Minutes
nTargetSpacing = 1 * 60 * 2; // OHMC New: 120 Seconds
nMaturity = 15;
nKarmanodeCountDrift = 4;
nModifierUpdateBlock = 51197; //approx Mon, 17 Apr 2017 04:00:00 GMT
nMaxMoneyOut = 43199500 * COIN;
nLastPOWBlock = 200;
nZerocoinStartHeight = 200;
nZerocoinStartHeight = 999999999;

nZerocoinLastOldParams = 50000;

//! Modify the testnet genesis block so the timestamp is valid for a later start.
genesis.nTime = 1454124731;
genesis.nNonce = 2402015;
genesis.nTime = 1597378077;
genesis.nNonce = 8142020;

hashGenesisBlock = genesis.GetHash();
//assert(hashGenesisBlock == uint256("0xfab709a0c107fe7cf6b0d552c514ef3228f9e0f107cd3c9b2fcea96512342cd8"));
Expand Down Expand Up @@ -563,6 +591,18 @@ class CTestNetParams : public CMainParams
strObfuscationPoolDummyAddress = "y57cqfGRkekRyDRNeJiLtYVEbvhXrNbmox";
nBudgetFeeConfirmations = 3; // Number of confirmations for the finalization fee. We have to make this very short
// here because we only have a 8 block finalization window on testnet

// Network upgrades
consensus.vUpgrades[Consensus::BASE_NETWORK].nActivationHeight =
Consensus::NetworkUpgrade::ALWAYS_ACTIVE;
consensus.vUpgrades[Consensus::UPGRADE_TESTDUMMY].nActivationHeight =
Consensus::NetworkUpgrade::NO_ACTIVATION_HEIGHT;
consensus.vUpgrades[Consensus::UPGRADE_V3_0_BLOCKTIME].nActivationHeight = 33001;
consensus.vUpgrades[Consensus::UPGRADE_V3_0_BLOCKREWARD].nActivationHeight = 33002;
consensus.vUpgrades[Consensus::UPGRADE_V3_1_DUMMY].nActivationHeight =
Consensus::NetworkUpgrade::NO_ACTIVATION_HEIGHT;
consensus.vUpgrades[Consensus::UPGRADE_V3_2_DUMMY].nActivationHeight =
Consensus::NetworkUpgrade::NO_ACTIVATION_HEIGHT;
}
const Checkpoints::CCheckpointData& Checkpoints() const
{
Expand Down Expand Up @@ -590,8 +630,12 @@ class CRegTestParams : public CTestNetParams
nRejectBlockOutdatedMajority = 950;
nToCheckBlockUpgradeMajority = 1000;
nMinerThreads = 1;
nTargetTimespan = 24 * 60 * 60; // Ohmcoin: 1 day
nTargetSpacing = 1 * 60; // Ohmcoin: 1 minutes
/* Legacy Blocktime */
nTargetTimespanLegacy = 1 * 60 * 60 * 24; // OHMC: 24 Hours
nTargetSpacingLegacy = 1 * 30; // OHMC: 22 Seconds
/* New Blocktime */
nTargetTimespan = 1 * 60 * 60 * 2; // OHMC New: 120 Minutes
nTargetSpacing = 1 * 60 * 4; // OHMC New: 240 Seconds
bnProofOfWorkLimit = ~uint256(0) >> 1;
genesis.nTime = 1454124731;
genesis.nBits = 0x207fffff;
Expand Down Expand Up @@ -623,11 +667,30 @@ class CRegTestParams : public CTestNetParams
// "PublicKey": "04866dc02c998b7e1ab16fe14e0d86554595da90c36acb706a4d763b58ed0edb1f82c87e3ced065c5b299b26e12496956b9e5f9f19aa008b5c46229b15477c875a"
// }
strSporkKey = "04866dc02c998b7e1ab16fe14e0d86554595da90c36acb706a4d763b58ed0edb1f82c87e3ced065c5b299b26e12496956b9e5f9f19aa008b5c46229b15477c875a";

// Network upgrades
consensus.vUpgrades[Consensus::BASE_NETWORK].nActivationHeight =
Consensus::NetworkUpgrade::ALWAYS_ACTIVE;
consensus.vUpgrades[Consensus::UPGRADE_TESTDUMMY].nActivationHeight =
Consensus::NetworkUpgrade::NO_ACTIVATION_HEIGHT;
consensus.vUpgrades[Consensus::UPGRADE_V3_0_BLOCKTIME].nActivationHeight = 33002;
consensus.vUpgrades[Consensus::UPGRADE_V3_0_BLOCKREWARD].nActivationHeight = 33002;
consensus.vUpgrades[Consensus::UPGRADE_V3_1_DUMMY].nActivationHeight =
Consensus::NetworkUpgrade::NO_ACTIVATION_HEIGHT;
consensus.vUpgrades[Consensus::UPGRADE_V3_2_DUMMY].nActivationHeight =
Consensus::NetworkUpgrade::NO_ACTIVATION_HEIGHT;
}

const Checkpoints::CCheckpointData& Checkpoints() const
{
return dataRegtest;
}

void UpdateNetworkUpgradeParameters(Consensus::UpgradeIndex idx, int nActivationHeight)
{
assert(idx > Consensus::BASE_NETWORK && idx < Consensus::MAX_NETWORK_UPGRADES);
consensus.vUpgrades[idx].nActivationHeight = nActivationHeight;
}
};
static CRegTestParams regTestParams;

Expand Down Expand Up @@ -715,3 +778,8 @@ bool SelectParamsFromCommandLine()
SelectParams(network);
return true;
}

void UpdateNetworkUpgradeParameters(Consensus::UpgradeIndex idx, int nActivationHeight)
{
regTestParams.UpdateNetworkUpgradeParameters(idx, nActivationHeight);
}
17 changes: 17 additions & 0 deletions src/chainparams.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "chainparamsbase.h"
#include "checkpoints.h"
#include "primitives/block.h"
#include "consensus/params.h"
#include "protocol.h"
#include "uint256.h"

Expand Down Expand Up @@ -46,6 +47,7 @@ class CChainParams
};

const uint256& HashGenesisBlock() const { return hashGenesisBlock; }
const Consensus::Params& GetConsensus() const { return consensus; }
const MessageStartChars& MessageStart() const { return pchMessageStart; }
const std::vector<unsigned char>& AlertKey() const { return vAlertPubKey; }
int GetDefaultPort() const { return nDefaultPort; }
Expand All @@ -71,11 +73,18 @@ class CChainParams
bool SkipProofOfWorkCheck() const { return fSkipProofOfWorkCheck; }
/** Make standard checks */
bool RequireStandard() const { return fRequireStandard; }
/** Legacy blocktime setting */
int64_t TargetTimespanLegacy() const { return nTargetTimespanLegacy; }
int64_t TargetSpacingLegacy() const { return nTargetSpacingLegacy; }
int64_t IntervalLegacy() const { return nTargetTimespanLegacy / nTargetSpacingLegacy; }
/** New blocktime setting */
int64_t TargetTimespan() const { return nTargetTimespan; }
int64_t TargetSpacing() const { return nTargetSpacing; }
int64_t Interval() const { return nTargetTimespan / nTargetSpacing; }
/** Majurity Checks */
int COINBASE_MATURITY() const { return nMaturity; }
unsigned int StakeMaturity() const { return nStakeMaturity; }
/** Max Money Checks */
CAmount MaxMoneyOut() const { return nMaxMoneyOut; }
/** The karmanode count that we will allow the see-saw reward payments to be off by */
int KarmanodeCountDrift() const { return nKarmanodeCountDrift; }
Expand Down Expand Up @@ -129,6 +138,8 @@ class CChainParams
int nToCheckBlockUpgradeMajority;
int64_t nTargetTimespan;
int64_t nTargetSpacing;
int64_t nTargetTimespanLegacy;
int64_t nTargetSpacingLegacy;
int nLastPOWBlock;
int nKarmanodeCountDrift;
int nMaturity;
Expand All @@ -142,6 +153,7 @@ class CChainParams
CBaseChainParams::Network networkID;
std::string strNetworkID;
CBlock genesis;
Consensus::Params consensus;
std::vector<CAddress> vFixedSeeds;
bool fMiningRequiresPeers;
bool fAllowMinDifficultyBlocks;
Expand Down Expand Up @@ -207,4 +219,9 @@ void SelectParams(CBaseChainParams::Network network);
*/
bool SelectParamsFromCommandLine();

/**
* Allows modifying the network upgrade regtest parameters.
*/
void UpdateNetworkUpgradeParameters(Consensus::UpgradeIndex idx, int nActivationHeight);

#endif // BITCOIN_CHAINPARAMS_H
26 changes: 26 additions & 0 deletions src/consensus/params.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (c) 2019 The Zcash developers
// Copyright (c) 2020 The PIVX developers
// Copyright (c) 2020 The OHMC developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or https://www.opensource.org/licenses/mit-license.php .

#include "consensus/params.h"
#include "consensus/upgrades.h"
#include "util.h"

namespace Consensus {

bool Params::NetworkUpgradeActive(int nHeight, Consensus::UpgradeIndex idx) const
{
if (idx >= Consensus::MAX_NETWORK_UPGRADES)
return error("%s: Upgrade index out of bounds: %d >= %d",
__func__, idx, Consensus::MAX_NETWORK_UPGRADES);

if (nHeight < 0)
return error("%s: Requested state for upgrade %s at negative height %d",
__func__, NetworkUpgradeInfo[idx].strName, nHeight);

return NetworkUpgradeState(nHeight, *this, idx) == UPGRADE_ACTIVE;
}

} // End consensus namespace
Loading