Good riddance
This commit is contained in:
1
COPYING
1
COPYING
@@ -3,7 +3,6 @@ Copyright (c) 2009-2018 Bitcoin Developers
|
||||
Copyright (c) 2016-2017 The Zcash developers
|
||||
Copyright (c) 2016-2019 The Komodo developers
|
||||
Copyright (c) 2018-2019 The Hush developers
|
||||
Copyright (c) 2018 The VerusCoin developers
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
|
||||
You will need Apple's Xcode (at least version 7, preferably 8.x) and the Xcode Command Line Tools:
|
||||
|
||||
https://itunes.apple.com/us/app/xcode/id497799835?mt=12
|
||||
|
||||
And Homebrew:
|
||||
|
||||
http://brew.sh/
|
||||
|
||||
Use the brewfile to install the necessary packages:
|
||||
|
||||
```shell
|
||||
brew bundle
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```shell
|
||||
brew tap discoteq/discoteq; brew install flock autoconf autogen automake gcc@6 binutils protobuf coreutils wget
|
||||
```
|
||||
|
||||
Get all that installed, then run:
|
||||
|
||||
```shell
|
||||
git clone https://github.com/MyHush/hush3
|
||||
cd hush3
|
||||
./zcutil/build-mac.sh
|
||||
```
|
||||
|
||||
To build a distributable version of Hush then run the makeReleaseMac.sh script after building. This will fix the dependency references and move the komodod and komodo-cli binaries to the kmd/mac/verus-cli directory along with the 6 libraries required for it to work properly.
|
||||
|
||||
When you are done building, you need to create `Komodo.conf` the Mac way.
|
||||
|
||||
```shell
|
||||
mkdir ~/Library/Application\ Support/Komodo
|
||||
touch ~/Library/Application\ Support/Komodo/Komodo.conf
|
||||
nano ~/Library/Application\ Support/Komodo/Komodo.conf
|
||||
```
|
||||
|
||||
Add the following lines to the Komodo.conf file:
|
||||
|
||||
```shell
|
||||
rpcuser=dontuseweakusernameoryougetrobbed
|
||||
rpcpassword=dontuseweakpasswordoryougetrobbed
|
||||
txindex=1
|
||||
addnode=5.9.102.210
|
||||
addnode=78.47.196.146
|
||||
addnode=178.63.69.164
|
||||
addnode=88.198.65.74
|
||||
addnode=5.9.122.241
|
||||
addnode=144.76.94.38
|
||||
addnode=89.248.166.91
|
||||
```
|
||||
|
||||
Happy Building
|
||||
@@ -1,4 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Copyright 2019 The Hush developers
|
||||
|
||||
set -e -o pipefail
|
||||
|
||||
CURDIR=$(cd $(dirname "$0"); pwd)
|
||||
@@ -14,7 +16,6 @@ testScripts=(
|
||||
'dpow.py'
|
||||
'dpowconfs.py'
|
||||
'ac_private.py'
|
||||
'verushash.py'
|
||||
'paymentdisclosure.py'
|
||||
'prioritisetransaction.py'
|
||||
'wallet_treestate.py'
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python2
|
||||
# Copyright (c) 2019 The Hush developers
|
||||
# Copyright (c) 2018 SuperNET developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
@@ -28,7 +29,7 @@ def generate_random_string(length):
|
||||
class AssetChainPrivateTest (BitcoinTestFramework):
|
||||
|
||||
def setup_chain(self):
|
||||
print("Initializing VerusHash test directory "+self.options.tmpdir)
|
||||
print("Initializing ac_private test directory "+self.options.tmpdir)
|
||||
self.num_nodes = 1
|
||||
initialize_chain_clean(self.options.tmpdir, self.num_nodes)
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ endif
|
||||
komodo_gtest_CPPFLAGS = $(AM_CPPFLAGS) -DMULTICORE -fopenmp -DBINARY_OUTPUT -DCURVE_ALT_BN128 -DSTATIC $(BITCOIN_INCLUDES)
|
||||
komodo_gtest_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
||||
|
||||
komodo_gtest_LDADD = -lgtest -lgmock $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBVERUS_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
|
||||
komodo_gtest_LDADD = -lgtest -lgmock $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
|
||||
$(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1)
|
||||
if ENABLE_ZMQ
|
||||
zcash_gtest_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
|
||||
|
||||
@@ -361,7 +361,7 @@ qt_komodo_qt_LDADD = qt/libbitcoinqt.a $(LIBBITCOIN_SERVER)
|
||||
if ENABLE_WALLET
|
||||
qt_komodo_qt_LDADD += $(LIBBITCOIN_WALLET)
|
||||
endif
|
||||
qt_komodo_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBVERUS_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
|
||||
qt_komodo_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
|
||||
$(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) $(LIBZCASH_LIBS)
|
||||
qt_komodo_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
||||
qt_komodo_qt_LIBTOOLFLAGS = --tag CXX
|
||||
|
||||
@@ -30,7 +30,7 @@ qt_test_test_komodo_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_SERVER)
|
||||
if ENABLE_WALLET
|
||||
qt_test_test_komodo_qt_LDADD += $(LIBBITCOIN_WALLET)
|
||||
endif
|
||||
qt_test_test_komodo_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBVERUS_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) \
|
||||
qt_test_test_komodo_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) \
|
||||
$(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \
|
||||
$(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) $(LIBZCASH_LIBS)
|
||||
qt_test_test_komodo_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
||||
|
||||
@@ -113,7 +113,7 @@ endif
|
||||
|
||||
test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
|
||||
test_test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) -fopenmp $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS) $(EVENT_CFLAGS)
|
||||
test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBVERUS_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
|
||||
test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
|
||||
$(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS)
|
||||
test_test_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
||||
if ENABLE_WALLET
|
||||
|
||||
@@ -24,7 +24,6 @@ zcash_CreateJoinSplit_LDADD = \
|
||||
$(LIBSNARK) \
|
||||
$(LIBBITCOIN_UTIL) \
|
||||
$(LIBBITCOIN_CRYPTO) \
|
||||
$(LIBVERUS_CRYPTO) \
|
||||
$(BOOST_LIBS) \
|
||||
$(LIBZCASH_LIBS) \
|
||||
$(LIBCRYPTOCONDITIONS) \
|
||||
|
||||
@@ -35,7 +35,6 @@ echo $pubkey
|
||||
./komodod -pubkey=$pubkey -ac_name=EQL -ac_supply=500000000 -ac_ccactivate=205000 -addnode=46.101.124.153 &
|
||||
./komodod -pubkey=$pubkey -ac_name=ZILLA -ac_supply=11000000 -ac_sapling=5000000 -addnode=51.68.215.104 &
|
||||
./komodod -pubkey=$pubkey -ac_name=RFOX -ac_supply=1000000000 -ac_reward=100000000 -addnode=95.213.238.98 &
|
||||
~/VerusCoin/src/komodod -pubkey=$pubkey -ac_name=VRSC -ac_algo=verushash -ac_cc=1 -ac_veruspos=50 -ac_supply=0 -ac_eras=3 -ac_reward=0,38400000000,2400000000 -ac_halving=1,43200,1051920 -ac_decay=100000000,0,0 -ac_end=10080,226080,0 -ac_timelockgte=19200000000 -ac_timeunlockfrom=129600 -ac_timeunlockto=1180800 -addnode=185.25.48.236 -addnode=185.64.105.111 &
|
||||
./komodod -pubkey=$pubkey -ac_name=SEC -ac_cc=333 -ac_supply=1000000000 -addnode=185.148.145.43 &
|
||||
./komodod -pubkey=$pubkey -ac_name=CCL -ac_supply=200000000 -ac_end=1 -ac_cc=2 -addressindex=1 -spentindex=1 -addnode=142.93.136.89 -addnode=195.201.22.89 &
|
||||
./komodod -pubkey=$pubkey -ac_name=PIRATE -ac_supply=0 -ac_reward=25600000000 -ac_halving=77777 -ac_private=1 -addnode=178.63.77.56 &
|
||||
@@ -48,10 +47,7 @@ echo $pubkey
|
||||
./komodod -pubkey=$pubkey -ac_name=ILN -ac_supply=10000000000 -ac_cc=2 -addressindex=1 -spentindex=1 -addnode=51.75.122.83 &
|
||||
./komodod -pubkey=$pubkey -ac_name=RICK -ac_supply=90000000000 -ac_reward=100000000 -ac_cc=3 -ac_staked=10 -addnode=95.217.44.58 -addnode=138.201.136.145 &
|
||||
./komodod -pubkey=$pubkey -ac_name=MORTY -ac_supply=90000000000 -ac_reward=100000000 -ac_cc=3 -ac_staked=10 -addnode=95.217.44.58 -addnode=138.201.136.145 &
|
||||
<<<<<<< HEAD
|
||||
./komodod -pubkey=$pubkey -ac_name=VOTE2019 -ac_supply=123651638 -ac_public=1 -addnode=95.213.238.98 &
|
||||
=======
|
||||
>>>>>>> beta
|
||||
./komodod -pubkey=$pubkey -ac_name=KOIN -ac_supply=125000000 -addnode=3.0.32.10 &
|
||||
./komodod -pubkey=$pubkey -ac_name=ZEXO -ac_supply=100000000 -ac_reward=1478310502 -ac_halving=525600 -ac_cc=42 -ac_ccenable=236 -ac_perc=77700 -ac_staked=93 -ac_pubkey=02713bd85e054db923694b6b7a85306264edf4d6bd6d331814f2b40af444b3ebbc -ac_public=1 -addnode=80.240.17.222 &
|
||||
./komodod -pubkey=$pubkey -ac_name=K64 -ac_supply=64000777 -ac_reward=0 -ac_staked=10 -addnode=18.197.20.211 &
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Copyright 2019 The Hush developers
|
||||
/******************************************************************************
|
||||
* Copyright © 2014-2019 The SuperNET Developers. *
|
||||
* *
|
||||
@@ -36,7 +37,6 @@
|
||||
* there should be a code identifying it. For example,
|
||||
* a possible code is EVAL_BITCOIN_SCRIPT, where the entire binary
|
||||
* after the code is interpreted as a bitcoin script.
|
||||
* Verus EVAL_STAKEGUARD is 0x01
|
||||
*/
|
||||
#define FOREACH_EVAL(EVAL) \
|
||||
EVAL(EVAL_IMPORTPAYOUT, 0xe1) \
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Copyright (c) 2010 Satoshi Nakamoto
|
||||
// Copyright (c) 2009-2014 The Bitcoin Core developers
|
||||
// Copyright (c) 2019 The Hush developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
@@ -581,22 +582,6 @@ void *chainparams_commandline()
|
||||
pCurrentParams->pchMessageStart[2] = (ASSETCHAINS_MAGIC >> 16) & 0xff;
|
||||
pCurrentParams->pchMessageStart[3] = (ASSETCHAINS_MAGIC >> 24) & 0xff;
|
||||
fprintf(stderr,">>>>>>>>>> %s: p2p.%u rpc.%u magic.%08x %u %u coins\n",ASSETCHAINS_SYMBOL,ASSETCHAINS_P2PPORT,ASSETCHAINS_RPCPORT,ASSETCHAINS_MAGIC,ASSETCHAINS_MAGIC,(uint32_t)ASSETCHAINS_SUPPLY);
|
||||
if (ASSETCHAINS_ALGO == ASSETCHAINS_VERUSHASH)
|
||||
{
|
||||
// this is only good for 60 second blocks with an averaging window of 45. for other parameters, use:
|
||||
// nLwmaAjustedWeight = (N+1)/2 * (0.9989^(500/nPowAveragingWindow)) * nPowTargetSpacing
|
||||
pCurrentParams->consensus.nLwmaAjustedWeight = 1350;
|
||||
pCurrentParams->consensus.nPowAveragingWindow = 45;
|
||||
pCurrentParams->consensus.powAlternate = uint256S("00000f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f");
|
||||
}
|
||||
else if (ASSETCHAINS_ALGO == ASSETCHAINS_VERUSHASHV1_1)
|
||||
{
|
||||
// this is only good for 60 second blocks with an averaging window of 45. for other parameters, use:
|
||||
// nLwmaAjustedWeight = (N+1)/2 * (0.9989^(500/nPowAveragingWindow)) * nPowTargetSpacing
|
||||
pCurrentParams->consensus.nLwmaAjustedWeight = 1350;
|
||||
pCurrentParams->consensus.nPowAveragingWindow = 45;
|
||||
pCurrentParams->consensus.powAlternate = uint256S("0000000f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f");
|
||||
}
|
||||
|
||||
if (ASSETCHAINS_LWMAPOS != 0)
|
||||
{
|
||||
@@ -604,54 +589,23 @@ void *chainparams_commandline()
|
||||
pCurrentParams->consensus.nPOSAveragingWindow = 45;
|
||||
// spacing is 1000 units per block to get better resolution, POS is 50% hard coded for now, we can vary it later
|
||||
// when we get reliable integer math on nLwmaPOSAjustedWeight
|
||||
pCurrentParams->consensus.nPOSTargetSpacing = VERUS_BLOCK_POSUNITS * 2;
|
||||
pCurrentParams->consensus.nPOSTargetSpacing = KOMODO_BLOCK_POSUNITS * 2;
|
||||
// nLwmaPOSAjustedWeight = (N+1)/2 * (0.9989^(500/nPOSAveragingWindow)) * nPOSTargetSpacing
|
||||
// this needs to be recalculated if VERUS_BLOCK_POSUNITS is changed
|
||||
// this needs to be recalculated if KOMODO_BLOCK_POSUNITS is changed
|
||||
pCurrentParams->consensus.nLwmaPOSAjustedWeight = 46531;
|
||||
}
|
||||
|
||||
// only require coinbase protection on Verus from the Komodo family of coins
|
||||
if (strcmp(ASSETCHAINS_SYMBOL,"VRSC") == 0)
|
||||
{
|
||||
pCurrentParams->consensus.vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight = 227520;
|
||||
pCurrentParams->consensus.vUpgrades[Consensus::UPGRADE_OVERWINTER].nActivationHeight = 227520;
|
||||
pCurrentParams->consensus.fCoinbaseMustBeProtected = true;
|
||||
checkpointData = //(Checkpoints::CCheckpointData)
|
||||
{
|
||||
boost::assign::map_list_of
|
||||
(0, pCurrentParams->consensus.hashGenesisBlock)
|
||||
(10000, uint256S("0xac2cd7d37177140ea4991cf630c0b9c7f94d707b84fb0351bf3a44856d2ae5dc"))
|
||||
(20000, uint256S("0xb0e8cb9f77aaa7ff5bd90d6c08d06f4c4bf03e00c2b8a35a042e760845590c8a"))
|
||||
(30000, uint256S("0xf2112ca577338ad7104bf905fa6a63d36b17a86f914c97b73cd31d43fcd7557c"))
|
||||
(40000, uint256S("0x00000000008f83378dab727864b763ce91a4ea5f75d55939c0c1390cfb8c38f1"))
|
||||
(49170, uint256S("0x2add646c0089871ec2379f02f7cd60b3af6efd9c152a6f16fc10925458c270cc")),
|
||||
(int64_t)1529910234, // * UNIX timestamp of last checkpoint block
|
||||
(int64_t)63661, // * total number of transactions between genesis and last checkpoint
|
||||
// (the tx=... number in the SetBestChain debug.log lines)
|
||||
(double)2777 // * estimated number of transactions per day after checkpoint
|
||||
// total number of tx / (checkpoint block height / (24 * 24))
|
||||
};
|
||||
|
||||
pCurrentParams->consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000001a8f4f23f8b2d1f7e");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strcmp(ASSETCHAINS_SYMBOL,"VRSCTEST") == 0 || strcmp(ASSETCHAINS_SYMBOL,"VERUSTEST") == 0)
|
||||
{
|
||||
pCurrentParams->consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000000000000000001f7e");
|
||||
}
|
||||
pCurrentParams->consensus.vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight = ASSETCHAINS_SAPLING;
|
||||
pCurrentParams->consensus.vUpgrades[Consensus::UPGRADE_OVERWINTER].nActivationHeight = ASSETCHAINS_OVERWINTER;
|
||||
checkpointData = //(Checkpoints::CCheckpointData)
|
||||
{
|
||||
boost::assign::map_list_of
|
||||
(0, pCurrentParams->consensus.hashGenesisBlock),
|
||||
(int64_t)1231006505,
|
||||
(int64_t)1,
|
||||
(double)2777 // * estimated number of transactions per day after checkpoint
|
||||
// total number of tx / (checkpoint block height / (24 * 24))
|
||||
};
|
||||
}
|
||||
pCurrentParams->consensus.vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight = ASSETCHAINS_SAPLING;
|
||||
pCurrentParams->consensus.vUpgrades[Consensus::UPGRADE_OVERWINTER].nActivationHeight = ASSETCHAINS_OVERWINTER;
|
||||
checkpointData = //(Checkpoints::CCheckpointData)
|
||||
{
|
||||
boost::assign::map_list_of
|
||||
(0, pCurrentParams->consensus.hashGenesisBlock),
|
||||
(int64_t)1231006505,
|
||||
(int64_t)1,
|
||||
(double)2777 // * estimated number of transactions per day after checkpoint
|
||||
// total number of tx / (checkpoint block height / (24 * 24))
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
#define DO_STRINGIZE(X) #X
|
||||
|
||||
//! Copyright string used in Windows .rc files
|
||||
#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin Core Developers, The Zcash developers, Komodo developers, Hush developers and Verus developers"
|
||||
#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin Core Developers, The Zcash developers, Komodo developers, Hush developers"
|
||||
|
||||
/**
|
||||
* bitcoind-res.rc includes this file, but it cannot cope with real c++ code.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||
// Copyright (c) 2009-2014 The Bitcoin Core developers
|
||||
// Copyright (c) 2019 The Hush developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
@@ -39,7 +40,6 @@
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include "zcash/IncrementalMerkleTree.hpp"
|
||||
//#include "veruslaunch.h"
|
||||
|
||||
/**
|
||||
* Pruned version of CTransaction: only retains metadata and unspent transaction outputs
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/bin/bash
|
||||
./komodo-cli -ac_name=VRSC $1 $2 $3 $4 $5 $6
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include "crypto/ripemd160.h"
|
||||
#include "crypto/sha256.h"
|
||||
#include "crypto/verus_hash.h"
|
||||
#include "prevector.h"
|
||||
#include "serialize.h"
|
||||
#include "uint256.h"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// Copyright 2019 The Hush Developers
|
||||
|
||||
/******************************************************************************
|
||||
* Copyright © 2014-2019 The SuperNET Developers. *
|
||||
* *
|
||||
@@ -1481,11 +1483,7 @@ arith_uint256 komodo_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t he
|
||||
}
|
||||
if ( m+n < 100 )
|
||||
{
|
||||
// We do actual PoS % at the start. Requires coin distribution in first 10 blocks!
|
||||
if ( ASSETCHAINS_ALGO == ASSETCHAINS_VERUSHASH || ASSETCHAINS_ALGO == ASSETCHAINS_VERUSHASHV1_1 )
|
||||
percPoS = (percPoS*100) / (m+n);
|
||||
else
|
||||
percPoS = ((percPoS * n) + (goalperc * (100-n))) / 100;
|
||||
percPoS = ((percPoS * n) + (goalperc * (100-n))) / 100;
|
||||
}
|
||||
if ( dispflag != 0 && ASSETCHAINS_STAKED < 100 )
|
||||
fprintf(stderr," -> %d%% percPoS vs goalperc.%d ht.%d\n",percPoS,goalperc,height);
|
||||
@@ -1583,24 +1581,6 @@ uint32_t komodo_stake(int32_t validateflag,arith_uint256 bnTarget,int32_t nHeigh
|
||||
if ( blocktime+iter+segid*2 < txtime+minage )
|
||||
continue;
|
||||
diff = (iter + blocktime - txtime - minage);
|
||||
if ( ASSETCHAINS_ALGO == ASSETCHAINS_VERUSHASH || ASSETCHAINS_ALGO == ASSETCHAINS_VERUSHASHV1_1 )
|
||||
{
|
||||
/*if ( PoSperc < ASSETCHAINS_STAKED )
|
||||
{
|
||||
// Under PoS % target and we need to increase diff.
|
||||
//fprintf(stderr, "PoS too low diff.%i changed to.",diff);
|
||||
diff = diff * ( (ASSETCHAINS_STAKED - PoSperc + 1) * (ASSETCHAINS_STAKED - PoSperc + 1) * ( nHeight < 50 ? 1000 : 1));
|
||||
//fprintf(stderr, "%i \n",diff);
|
||||
}
|
||||
else */
|
||||
if ( PoSperc > ASSETCHAINS_STAKED )
|
||||
{
|
||||
// Over PoS target need to lower diff.
|
||||
//fprintf(stderr, "PoS too high diff.%i changed to.",diff);
|
||||
diff = diff / ( (PoSperc - ASSETCHAINS_STAKED + 1) * (PoSperc - ASSETCHAINS_STAKED + 1) );
|
||||
//fprintf(stderr, "%i \n",diff);
|
||||
}
|
||||
}
|
||||
if ( diff < 0 )
|
||||
diff = 60;
|
||||
else if ( diff > 3600*24*30 )
|
||||
@@ -1611,17 +1591,6 @@ uint32_t komodo_stake(int32_t validateflag,arith_uint256 bnTarget,int32_t nHeigh
|
||||
if ( iter > 0 )
|
||||
diff += segid*2;
|
||||
coinage = (value * diff);
|
||||
if ( ASSETCHAINS_ALGO == ASSETCHAINS_VERUSHASH || ASSETCHAINS_ALGO == ASSETCHAINS_VERUSHASHV1_1 )
|
||||
{
|
||||
if ( PoSperc < ASSETCHAINS_STAKED )
|
||||
{
|
||||
// Under PoS % target and we need to increase diff.
|
||||
//fprintf(stderr, "PoS too low diff.%i changed to.",diff);
|
||||
if ( blocktime+iter+segid*2 > prevtime+128 )
|
||||
coinage *= ((blocktime+iter+segid*2) - (prevtime+102));
|
||||
//fprintf(stderr, "%i \n",diff);
|
||||
}
|
||||
}
|
||||
if ( blocktime+iter+segid*2 > prevtime+480 )
|
||||
coinage *= ((blocktime+iter+segid*2) - (prevtime+400));
|
||||
coinage256 = arith_uint256(coinage+1);
|
||||
@@ -1752,11 +1721,6 @@ int32_t komodo_is_PoSblock(int32_t slowflag,int32_t height,CBlock *pblock,arith_
|
||||
bool GetStakeParams(const CTransaction &stakeTx, CStakeParams &stakeParams);
|
||||
bool ValidateMatchingStake(const CTransaction &ccTx, uint32_t voutNum, const CTransaction &stakeTx, bool &cheating);
|
||||
|
||||
// for now, we will ignore slowFlag in the interest of keeping success/fail simpler for security purposes
|
||||
bool verusCheckPOSBlock(int32_t slowflag, CBlock *pblock, int32_t height)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint64_t komodo_notarypayamount(int32_t nHeight, int64_t notarycount)
|
||||
{
|
||||
@@ -2120,13 +2084,6 @@ int32_t komodo_checkPOW(int32_t slowflag,CBlock *pblock,int32_t height)
|
||||
// bnTarget = komodo_adaptivepow_target(height,bnTarget,pblock->nTime);
|
||||
if ( ASSETCHAINS_LWMAPOS != 0 && bhash > bnTarget )
|
||||
{
|
||||
/*
|
||||
// if proof of stake is active, check if this is a valid PoS block before we fail
|
||||
if (verusCheckPOSBlock(slowflag, pblock, height))
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
*/
|
||||
}
|
||||
if ( (ASSETCHAINS_SYMBOL[0] != 0 || height > 792000) && bhash > bnTarget )
|
||||
{
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Copyright © 2019 The Hush developers
|
||||
/******************************************************************************
|
||||
* Copyright © 2014-2019 The SuperNET Developers. *
|
||||
* *
|
||||
@@ -270,24 +271,23 @@ int32_t MAX_BLOCK_SIZE(int32_t height);
|
||||
extern char ASSETCHAINS_SYMBOL[KOMODO_ASSETCHAIN_MAXLEN];
|
||||
extern uint16_t ASSETCHAINS_P2PPORT,ASSETCHAINS_RPCPORT;
|
||||
extern uint32_t ASSETCHAIN_INIT, ASSETCHAINS_MAGIC;
|
||||
extern int32_t VERUS_BLOCK_POSUNITS, ASSETCHAINS_LWMAPOS, ASSETCHAINS_SAPLING, ASSETCHAINS_OVERWINTER,ASSETCHAINS_BLOCKTIME;
|
||||
extern int32_t ASSETCHAINS_LWMAPOS, ASSETCHAINS_SAPLING, ASSETCHAINS_OVERWINTER,ASSETCHAINS_BLOCKTIME;
|
||||
extern uint64_t ASSETCHAINS_SUPPLY, ASSETCHAINS_FOUNDERS_REWARD;
|
||||
|
||||
extern uint64_t ASSETCHAINS_TIMELOCKGTE;
|
||||
extern uint32_t ASSETCHAINS_ALGO, ASSETCHAINS_VERUSHASH,ASSETCHAINS_EQUIHASH,KOMODO_INITDONE;
|
||||
extern uint32_t ASSETCHAINS_ALGO, ASSETCHAINS_EQUIHASH,KOMODO_INITDONE;
|
||||
|
||||
extern int32_t KOMODO_MININGTHREADS,KOMODO_LONGESTCHAIN,ASSETCHAINS_SEED,IS_KOMODO_NOTARY,USE_EXTERNAL_PUBKEY,KOMODO_CHOSEN_ONE,KOMODO_ON_DEMAND,KOMODO_PASSPORT_INITDONE,ASSETCHAINS_STAKED,KOMODO_NSPV;
|
||||
extern uint64_t ASSETCHAINS_COMMISSION, ASSETCHAINS_LASTERA,ASSETCHAINS_CBOPRET;
|
||||
extern bool VERUS_MINTBLOCKS;
|
||||
extern uint64_t ASSETCHAINS_REWARD[ASSETCHAINS_MAX_ERAS+1], ASSETCHAINS_NOTARY_PAY[ASSETCHAINS_MAX_ERAS+1], ASSETCHAINS_TIMELOCKGTE, ASSETCHAINS_NONCEMASK[],ASSETCHAINS_NK[2];
|
||||
extern const char *ASSETCHAINS_ALGORITHMS[];
|
||||
extern int32_t VERUS_MIN_STAKEAGE;
|
||||
extern uint32_t ASSETCHAINS_VERUSHASH, ASSETCHAINS_VERUSHASHV1_1, ASSETCHAINS_NONCESHIFT[], ASSETCHAINS_HASHESPERROUND[];
|
||||
extern uint32_t ASSETCHAINS_NONCESHIFT[], ASSETCHAINS_HASHESPERROUND[];
|
||||
extern std::string NOTARY_PUBKEY,ASSETCHAINS_OVERRIDE_PUBKEY,ASSETCHAINS_SCRIPTPUB;
|
||||
extern uint8_t NOTARY_PUBKEY33[33],ASSETCHAINS_OVERRIDE_PUBKEY33[33],ASSETCHAINS_MARMARA;
|
||||
extern std::vector<std::string> ASSETCHAINS_PRICES,ASSETCHAINS_STOCKS;
|
||||
|
||||
extern int32_t VERUS_BLOCK_POSUNITS, VERUS_CONSECUTIVE_POS_THRESHOLD, VERUS_NOPOS_THRESHHOLD;
|
||||
extern int32_t KOMODO_BLOCK_POSUNITS, KOMODO_CONSECUTIVE_POS_THRESHOLD, KOMODO_NOPOS_THRESHHOLD;
|
||||
|
||||
extern uint256 KOMODO_EARLYTXID;
|
||||
|
||||
extern int32_t KOMODO_CONNECTING,KOMODO_CCACTIVATE,KOMODO_DEALERNODE;
|
||||
@@ -298,7 +298,6 @@ extern uint8_t ASSETCHAINS_CCDISABLES[256];
|
||||
extern int32_t USE_EXTERNAL_PUBKEY;
|
||||
extern std::string NOTARY_PUBKEY;
|
||||
extern int32_t KOMODO_EXCHANGEWALLET;
|
||||
extern int32_t VERUS_MIN_STAKEAGE;
|
||||
extern std::string DONATION_PUBKEY;
|
||||
extern uint8_t ASSETCHAINS_PRIVATE;
|
||||
extern int32_t USE_EXTERNAL_PUBKEY;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Copyright 2019 The Hush developers
|
||||
/******************************************************************************
|
||||
* Copyright © 2014-2019 The SuperNET Developers. *
|
||||
* *
|
||||
@@ -727,7 +728,6 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block,uint32_t prevtim
|
||||
return(-1);
|
||||
}
|
||||
}
|
||||
// we don't want these checks in VRSC, leave it at the Sapling upgrade
|
||||
if ( ASSETCHAINS_SYMBOL[0] == 0 ||
|
||||
((ASSETCHAINS_COMMISSION != 0 || ASSETCHAINS_FOUNDERS_REWARD) && height > 1) ||
|
||||
NetworkUpgradeActive(height, Params().GetConsensus(), Consensus::UPGRADE_SAPLING) )
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// Copyright 2019 The Hush Developers
|
||||
|
||||
/******************************************************************************
|
||||
* Copyright © 2014-2019 The SuperNET Developers. *
|
||||
* *
|
||||
@@ -46,13 +48,17 @@ struct komodo_state KOMODO_STATES[34];
|
||||
int COINBASE_MATURITY = _COINBASE_MATURITY;//100;
|
||||
unsigned int WITNESS_CACHE_SIZE = _COINBASE_MATURITY+10;
|
||||
uint256 KOMODO_EARLYTXID;
|
||||
int32_t KOMODO_BLOCK_POSUNITS = 1024; // one block is 1024 units
|
||||
int32_t KOMODO_MIN_STAKEAGE = 150; // 1/2 this should also be a cap on the POS averaging window, or startup could be too easy
|
||||
int32_t KOMODO_CONSECUTIVE_POS_THRESHOLD = 7;
|
||||
int32_t KOMODO_NOPOS_THRESHHOLD = 150; // if we have no POS blocks in this many blocks, set to default difficulty
|
||||
|
||||
|
||||
int32_t KOMODO_MININGTHREADS = -1,IS_KOMODO_NOTARY,IS_STAKED_NOTARY,USE_EXTERNAL_PUBKEY,KOMODO_CHOSEN_ONE,ASSETCHAINS_SEED,KOMODO_ON_DEMAND,KOMODO_EXTERNAL_NOTARIES,KOMODO_PASSPORT_INITDONE,KOMODO_PAX,KOMODO_EXCHANGEWALLET,KOMODO_REWIND,STAKED_ERA,KOMODO_CONNECTING = -1,KOMODO_DEALERNODE,KOMODO_EXTRASATOSHI,ASSETCHAINS_FOUNDERS,ASSETCHAINS_CBMATURITY,KOMODO_NSPV;
|
||||
int32_t KOMODO_INSYNC,KOMODO_LASTMINED,prevKOMODO_LASTMINED,KOMODO_CCACTIVATE,JUMBLR_PAUSE = 1;
|
||||
std::string NOTARY_PUBKEY,ASSETCHAINS_NOTARIES,ASSETCHAINS_OVERRIDE_PUBKEY,DONATION_PUBKEY,ASSETCHAINS_SCRIPTPUB,NOTARY_ADDRESS,ASSETCHAINS_SELFIMPORT,ASSETCHAINS_CCLIB;
|
||||
uint8_t NOTARY_PUBKEY33[33],ASSETCHAINS_OVERRIDE_PUBKEY33[33],ASSETCHAINS_OVERRIDE_PUBKEYHASH[20],ASSETCHAINS_PUBLIC,ASSETCHAINS_PRIVATE,ASSETCHAINS_TXPOW,ASSETCHAINS_MARMARA;
|
||||
int8_t ASSETCHAINS_ADAPTIVEPOW;
|
||||
bool VERUS_MINTBLOCKS;
|
||||
std::vector<uint8_t> Mineropret;
|
||||
std::vector<std::string> vWhiteListAddress;
|
||||
char NOTARYADDRS[64][64];
|
||||
@@ -83,23 +89,14 @@ std::vector<std::string> ASSETCHAINS_PRICES,ASSETCHAINS_STOCKS;
|
||||
#define _ASSETCHAINS_EQUIHASH 0
|
||||
uint32_t ASSETCHAINS_NUMALGOS = 3;
|
||||
uint32_t ASSETCHAINS_EQUIHASH = _ASSETCHAINS_EQUIHASH;
|
||||
uint32_t ASSETCHAINS_VERUSHASH = 1;
|
||||
uint32_t ASSETCHAINS_VERUSHASHV1_1 = 2;
|
||||
const char *ASSETCHAINS_ALGORITHMS[] = {"equihash", "verushash", "verushash11"};
|
||||
uint64_t ASSETCHAINS_NONCEMASK[] = {0xffff,0xfffffff,0xfffffff};
|
||||
uint32_t ASSETCHAINS_NONCESHIFT[] = {32,16,16};
|
||||
uint32_t ASSETCHAINS_HASHESPERROUND[] = {1,4096,4096};
|
||||
const char *ASSETCHAINS_ALGORITHMS[] = {"equihash"};
|
||||
uint64_t ASSETCHAINS_NONCEMASK[] = {0xffff};
|
||||
uint32_t ASSETCHAINS_NONCESHIFT[] = {32};
|
||||
uint32_t ASSETCHAINS_HASHESPERROUND[] = {1};
|
||||
uint32_t ASSETCHAINS_ALGO = _ASSETCHAINS_EQUIHASH;
|
||||
// min diff returned from GetNextWorkRequired needs to be added here for each algo, so they can work with ac_staked.
|
||||
uint32_t ASSETCHAINS_MINDIFF[] = {537857807,504303375,487526159};
|
||||
// ^ wrong!
|
||||
// Verus proof of stake controls
|
||||
uint32_t ASSETCHAINS_MINDIFF[] = {537857807};
|
||||
int32_t ASSETCHAINS_LWMAPOS = 0; // percentage of blocks should be PoS
|
||||
int32_t VERUS_BLOCK_POSUNITS = 1024; // one block is 1000 units
|
||||
int32_t VERUS_MIN_STAKEAGE = 150; // 1/2 this should also be a cap on the POS averaging window, or startup could be too easy
|
||||
int32_t VERUS_CONSECUTIVE_POS_THRESHOLD = 7;
|
||||
int32_t VERUS_NOPOS_THRESHHOLD = 150; // if we have no POS blocks in this many blocks, set to default difficulty
|
||||
|
||||
int32_t ASSETCHAINS_SAPLING = -1;
|
||||
int32_t ASSETCHAINS_OVERWINTER = -1;
|
||||
|
||||
|
||||
@@ -1055,19 +1055,11 @@ int64_t komodo_block_unlocktime(uint32_t nHeight)
|
||||
unlocktime = ASSETCHAINS_TIMEUNLOCKTO;
|
||||
else
|
||||
{
|
||||
if (strcmp(ASSETCHAINS_SYMBOL, "VRSC") != 0 || nHeight >= 12800)
|
||||
{
|
||||
unlocktime = komodo_block_prg(nHeight) % (ASSETCHAINS_TIMEUNLOCKTO - ASSETCHAINS_TIMEUNLOCKFROM);
|
||||
unlocktime += ASSETCHAINS_TIMEUNLOCKFROM;
|
||||
}
|
||||
else
|
||||
{
|
||||
unlocktime = komodo_block_prg(nHeight) / (0xffffffffffffffff / ((ASSETCHAINS_TIMEUNLOCKTO - ASSETCHAINS_TIMEUNLOCKFROM) + 1));
|
||||
// boundary and power of 2 can make it exceed to time by 1
|
||||
unlocktime = unlocktime + ASSETCHAINS_TIMEUNLOCKFROM;
|
||||
if (unlocktime > ASSETCHAINS_TIMEUNLOCKTO)
|
||||
unlocktime--;
|
||||
}
|
||||
unlocktime = komodo_block_prg(nHeight) / (0xffffffffffffffff / ((ASSETCHAINS_TIMEUNLOCKTO - ASSETCHAINS_TIMEUNLOCKFROM) + 1));
|
||||
// boundary and power of 2 can make it exceed to time by 1
|
||||
unlocktime = unlocktime + ASSETCHAINS_TIMEUNLOCKFROM;
|
||||
if (unlocktime > ASSETCHAINS_TIMEUNLOCKTO)
|
||||
unlocktime--;
|
||||
}
|
||||
return ((int64_t)unlocktime);
|
||||
}
|
||||
@@ -1977,7 +1969,7 @@ void komodo_args(char *argv0)
|
||||
|
||||
// for now, we only support 50% PoS due to other parts of the algorithm needing adjustment for
|
||||
// other values
|
||||
if ( (ASSETCHAINS_LWMAPOS = GetArg("-ac_veruspos",0)) != 0 )
|
||||
if ( (ASSETCHAINS_LWMAPOS = GetArg("-ac_lwmapos",0)) != 0 )
|
||||
{
|
||||
ASSETCHAINS_LWMAPOS = 50;
|
||||
}
|
||||
@@ -2339,8 +2331,6 @@ fprintf(stderr,"extralen.%d before disable bits\n",extralen);
|
||||
ASSETCHAINS_HALVING[0] *= 5;
|
||||
fprintf(stderr,"PIRATE halving changed to %d %.1f days ASSETCHAINS_LASTERA.%llu\n",(int32_t)ASSETCHAINS_HALVING[0],(double)ASSETCHAINS_HALVING[0]/1440,(long long)ASSETCHAINS_LASTERA);
|
||||
}
|
||||
else if ( strcmp("VRSC",ASSETCHAINS_SYMBOL) == 0 )
|
||||
dpowconfs = 0;
|
||||
else if ( ASSETCHAINS_PRIVATE != 0 )
|
||||
{
|
||||
fprintf(stderr,"-ac_private for a non-PIRATE chain is not supported. The only reason to have an -ac_private chain is for total privacy and that is best achieved with the largest anon set. PIRATE has that and it is recommended to just use PIRATE\n");
|
||||
|
||||
47
src/main.cpp
47
src/main.cpp
@@ -1110,42 +1110,7 @@ unsigned int GetP2SHSigOpCount(const CTransaction& tx, const CCoinsViewCache& in
|
||||
*/
|
||||
bool ContextualCheckCoinbaseTransaction(int32_t slowflag,const CBlock *block,CBlockIndex * const previndex,const CTransaction& tx, const int nHeight,int32_t validateprices)
|
||||
{
|
||||
// if time locks are on, ensure that this coin base is time locked exactly as it should be
|
||||
if (((uint64_t)(tx.GetValueOut()) >= ASSETCHAINS_TIMELOCKGTE) ||
|
||||
(((nHeight >= 31680) || strcmp(ASSETCHAINS_SYMBOL, "VRSC") != 0) && komodo_ac_block_subsidy(nHeight) >= ASSETCHAINS_TIMELOCKGTE))
|
||||
{
|
||||
CScriptID scriptHash;
|
||||
|
||||
// to be valid, it must be a P2SH transaction and have an op_return in vout[1] that
|
||||
// holds the full output script, which may include multisig, etc., but starts with
|
||||
// the time lock verify of the correct time lock for this block height
|
||||
if (tx.vout.size() == 2 &&
|
||||
CScriptExt(tx.vout[0].scriptPubKey).IsPayToScriptHash(&scriptHash) &&
|
||||
tx.vout[1].scriptPubKey.size() >= 7 && // minimum for any possible future to prevent out of bounds
|
||||
tx.vout[1].scriptPubKey[0] == OP_RETURN)
|
||||
{
|
||||
opcodetype op;
|
||||
std::vector<uint8_t> opretData = std::vector<uint8_t>();
|
||||
CScript::const_iterator it = tx.vout[1].scriptPubKey.begin() + 1;
|
||||
if (tx.vout[1].scriptPubKey.GetOp2(it, op, &opretData))
|
||||
{
|
||||
if (opretData.size() > 0 && opretData.data()[0] == OPRETTYPE_TIMELOCK)
|
||||
{
|
||||
int64_t unlocktime;
|
||||
CScriptExt opretScript = CScriptExt(&opretData[1], &opretData[opretData.size()]);
|
||||
|
||||
if (CScriptID(opretScript) == scriptHash &&
|
||||
opretScript.IsCheckLockTimeVerify(&unlocktime) &&
|
||||
komodo_block_unlocktime(nHeight) == unlocktime)
|
||||
{
|
||||
return(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return(false);
|
||||
}
|
||||
else if ( ASSETCHAINS_MARMARA != 0 && nHeight > 0 && (nHeight & 1) == 0 )
|
||||
if ( ASSETCHAINS_MARMARA != 0 && nHeight > 0 && (nHeight & 1) == 0 )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -2837,16 +2802,6 @@ namespace Consensus {
|
||||
REJECT_INVALID, "bad-txns-premature-spend-of-coinbase");
|
||||
}
|
||||
|
||||
// Ensure that coinbases cannot be spent to transparent outputs
|
||||
// Disabled on regtest
|
||||
if (fCoinbaseEnforcedProtectionEnabled &&
|
||||
consensusParams.fCoinbaseMustBeProtected &&
|
||||
!(tx.vout.size() == 0 || (tx.vout.size() == 1 && tx.vout[0].nValue == 0)) &&
|
||||
(strcmp(ASSETCHAINS_SYMBOL, "VRSC") != 0 || (nSpendHeight >= 12800 && coins->nHeight >= 12800))) {
|
||||
return state.DoS(100,
|
||||
error("CheckInputs(): tried to spend coinbase with transparent outputs"),
|
||||
REJECT_INVALID, "bad-txns-coinbase-spend-has-transparent-outputs");
|
||||
}
|
||||
}
|
||||
|
||||
// Check for negative or overflow input values
|
||||
|
||||
@@ -137,12 +137,7 @@ int64_t GetUptime()
|
||||
|
||||
double GetLocalSolPS()
|
||||
{
|
||||
if (ASSETCHAINS_ALGO == ASSETCHAINS_VERUSHASH || ASSETCHAINS_ALGO == ASSETCHAINS_VERUSHASHV1_1)
|
||||
{
|
||||
return miningTimer.rate(nHashCount);
|
||||
}
|
||||
else
|
||||
return miningTimer.rate(solutionTargetChecks);
|
||||
return miningTimer.rate(solutionTargetChecks);
|
||||
}
|
||||
|
||||
int EstimateNetHeightInner(int height, int64_t tipmediantime,
|
||||
|
||||
@@ -593,7 +593,7 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32
|
||||
blocktime = GetAdjustedTime();
|
||||
siglen = komodo_staked(txStaked, pblock->nBits, &blocktime, &txtime, &utxotxid, &utxovout, &utxovalue, utxosig);
|
||||
// if you skip this check it will create a block too far into the future and not pass ProcessBlock or AcceptBlock.
|
||||
// This has been moved from the mining loop to save CPU, and to also make ac_staked work with the verus miner.
|
||||
// This has been moved from the mining loop to save CPU, and to also make ac_staked work
|
||||
while ( blocktime-57 > GetAdjustedTime() )
|
||||
{
|
||||
sleep(1);
|
||||
@@ -1634,7 +1634,7 @@ void static BitcoinMiner()
|
||||
return;
|
||||
}
|
||||
|
||||
if ((nThreads == 0 || !fGenerate) && (VERUS_MINTBLOCKS == 0 || pwallet == NULL))
|
||||
if ((nThreads == 0 || !fGenerate) && (pwallet == NULL))
|
||||
return;
|
||||
|
||||
minerThreads = new boost::thread_group();
|
||||
|
||||
34
src/pow.cpp
34
src/pow.cpp
@@ -644,20 +644,13 @@ uint32_t lwmaGetNextPOSRequired(const CBlockIndex* pindexLast, const Consensus::
|
||||
// if we have had no POS block in the threshold number of blocks, we must return the default, otherwise, we'll now have
|
||||
// a starting point
|
||||
uint32_t nBits = nProofOfStakeLimit;
|
||||
for (int64_t i = 0; i < VERUS_NOPOS_THRESHHOLD; i++)
|
||||
for (int64_t i = 0; i < KOMODO_NOPOS_THRESHHOLD; i++)
|
||||
{
|
||||
if (!pindexFirst)
|
||||
return nProofOfStakeLimit;
|
||||
|
||||
CBlockHeader hdr = pindexFirst->GetBlockHeader();
|
||||
|
||||
/*
|
||||
if (hdr.IsVerusPOSBlock())
|
||||
{
|
||||
nBits = hdr.GetVerusPOSTarget();
|
||||
break;
|
||||
}
|
||||
*/
|
||||
pindexFirst = pindexFirst->pprev;
|
||||
}
|
||||
|
||||
@@ -667,10 +660,10 @@ uint32_t lwmaGetNextPOSRequired(const CBlockIndex* pindexLast, const Consensus::
|
||||
|
||||
for (int64_t i = N - 1; i >= 0; i--)
|
||||
{
|
||||
// we measure our solve time in passing of blocks, where one bock == VERUS_BLOCK_POSUNITS units
|
||||
// we measure our solve time in passing of blocks, where one bock == KOMODO_BLOCK_POSUNITS units
|
||||
// consecutive blocks in either direction have their solve times exponentially multiplied or divided by power of 2
|
||||
int x;
|
||||
for (x = 0; x < VERUS_CONSECUTIVE_POS_THRESHOLD; x++)
|
||||
for (x = 0; x < KOMODO_CONSECUTIVE_POS_THRESHOLD; x++)
|
||||
{
|
||||
pindexFirst = pindexFirst->pprev;
|
||||
|
||||
@@ -678,29 +671,17 @@ uint32_t lwmaGetNextPOSRequired(const CBlockIndex* pindexLast, const Consensus::
|
||||
return nProofOfStakeLimit;
|
||||
|
||||
CBlockHeader hdr = pindexFirst->GetBlockHeader();
|
||||
/*
|
||||
if (hdr.IsVerusPOSBlock())
|
||||
{
|
||||
nBits = hdr.GetVerusPOSTarget();
|
||||
break;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
if (x)
|
||||
{
|
||||
idx[i].consecutive = false;
|
||||
if (!memcmp(ASSETCHAINS_SYMBOL, "VRSC", 4) && pindexLast->GetHeight() < 67680)
|
||||
{
|
||||
idx[i].solveTime = VERUS_BLOCK_POSUNITS * (x + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
int64_t lastSolveTime = 0;
|
||||
idx[i].solveTime = VERUS_BLOCK_POSUNITS;
|
||||
idx[i].solveTime = KOMODO_BLOCK_POSUNITS;
|
||||
for (int64_t j = 0; j < x; j++)
|
||||
{
|
||||
lastSolveTime = VERUS_BLOCK_POSUNITS + (lastSolveTime >> 1);
|
||||
lastSolveTime = KOMODO_BLOCK_POSUNITS + (lastSolveTime >> 1);
|
||||
idx[i].solveTime += lastSolveTime;
|
||||
}
|
||||
}
|
||||
@@ -712,13 +693,13 @@ uint32_t lwmaGetNextPOSRequired(const CBlockIndex* pindexLast, const Consensus::
|
||||
idx[i].nBits = nBits;
|
||||
// go forward and halve the minimum solve time for all consecutive blocks in this run, to get here, our last block is POS,
|
||||
// and if there is no POS block in front of it, it gets the normal solve time of one block
|
||||
uint32_t st = VERUS_BLOCK_POSUNITS;
|
||||
uint32_t st = KOMODO_BLOCK_POSUNITS;
|
||||
for (int64_t j = i; j < N; j++)
|
||||
{
|
||||
if (idx[j].consecutive == true)
|
||||
{
|
||||
idx[j].solveTime = st;
|
||||
if ((j - i) >= VERUS_CONSECUTIVE_POS_THRESHOLD)
|
||||
if ((j - i) >= KOMODO_CONSECUTIVE_POS_THRESHOLD)
|
||||
{
|
||||
// if this is real time, return zero
|
||||
if (j == (N - 1))
|
||||
@@ -875,7 +856,6 @@ bool CheckProofOfWork(const CBlockHeader &blkHeader, uint8_t *pubkey33, int32_t
|
||||
//else if ( ASSETCHAINS_ADAPTIVEPOW > 0 && ASSETCHAINS_STAKED == 0 )
|
||||
// bnTarget = komodo_adaptivepow_target(height,bnTarget,blkHeader.nTime);
|
||||
// Check proof of work matches claimed amount
|
||||
//if ( UintToArith256(hash = blkHeader.GetHash()) > bnTarget && !blkHeader.IsVerusPOSBlock() )
|
||||
if ( UintToArith256(hash = blkHeader.GetHash()) > bnTarget )
|
||||
{
|
||||
if ( KOMODO_LOADINGBLOCKS != 0 )
|
||||
|
||||
@@ -162,7 +162,6 @@ UniValue getnetworkhashps(const UniValue& params, bool fHelp)
|
||||
}
|
||||
|
||||
#ifdef ENABLE_MINING
|
||||
extern bool VERUS_MINTBLOCKS;
|
||||
UniValue getgenerate(const UniValue& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() != 0)
|
||||
@@ -184,7 +183,7 @@ UniValue getgenerate(const UniValue& params, bool fHelp)
|
||||
|
||||
LOCK(cs_main);
|
||||
UniValue obj(UniValue::VOBJ);
|
||||
bool staking = VERUS_MINTBLOCKS;
|
||||
bool staking = false;
|
||||
if ( ASSETCHAINS_STAKED != 0 && GetBoolArg("-gen", false) && GetBoolArg("-genproclimit", -1) == 0 )
|
||||
staking = true;
|
||||
obj.push_back(Pair("staking", staking));
|
||||
@@ -374,13 +373,11 @@ UniValue setgenerate(const UniValue& params, bool fHelp)
|
||||
{
|
||||
if (fGenerate && !nGenProcLimit)
|
||||
{
|
||||
VERUS_MINTBLOCKS = 1;
|
||||
fGenerate = GetBoolArg("-gen", false);
|
||||
KOMODO_MININGTHREADS = nGenProcLimit;
|
||||
}
|
||||
else if (!fGenerate)
|
||||
{
|
||||
VERUS_MINTBLOCKS = 0;
|
||||
KOMODO_MININGTHREADS = 0;
|
||||
}
|
||||
else KOMODO_MININGTHREADS = (int32_t)nGenProcLimit;
|
||||
@@ -499,9 +496,7 @@ UniValue getmininginfo(const UniValue& params, bool fHelp)
|
||||
obj.push_back(Pair("testnet", Params().TestnetToBeDeprecatedFieldRPC()));
|
||||
obj.push_back(Pair("chain", Params().NetworkIDString()));
|
||||
#ifdef ENABLE_MINING
|
||||
bool staking = VERUS_MINTBLOCKS;
|
||||
if ( ASSETCHAINS_STAKED != 0 && GetBoolArg("-gen", false) && GetBoolArg("-genproclimit", -1) == 0 )
|
||||
staking = true;
|
||||
bool staking = false;
|
||||
obj.push_back(Pair("staking", staking));
|
||||
obj.push_back(Pair("generate", GetBoolArg("-gen", false) && GetBoolArg("-genproclimit", -1) != 0 ));
|
||||
obj.push_back(Pair("numthreads", (int64_t)KOMODO_MININGTHREADS));
|
||||
|
||||
@@ -353,7 +353,7 @@ UniValue getinfo(const UniValue& params, bool fHelp)
|
||||
if ( ASSETCHAINS_STAKED != 0 )
|
||||
obj.push_back(Pair("staked", ASSETCHAINS_STAKED));
|
||||
if ( ASSETCHAINS_LWMAPOS != 0 )
|
||||
obj.push_back(Pair("veruspos", ASSETCHAINS_LWMAPOS));
|
||||
obj.push_back(Pair("lwmapos", ASSETCHAINS_LWMAPOS));
|
||||
if ( ASSETCHAINS_ALGO != ASSETCHAINS_EQUIHASH )
|
||||
obj.push_back(Pair("algo",ASSETCHAINS_ALGORITHMS[ASSETCHAINS_ALGO]));
|
||||
}
|
||||
|
||||
@@ -1031,9 +1031,8 @@ std::string LicenseInfo()
|
||||
FormatParagraph(strprintf(_("Copyright (C) 2015-%i The Zcash Developers"), COPYRIGHT_YEAR)) + "\n" +
|
||||
FormatParagraph(strprintf(_("Copyright (C) 2015-%i jl777 and SuperNET developers"), COPYRIGHT_YEAR)) + "\n" +
|
||||
FormatParagraph(strprintf(_("Copyright (C) 2018-%i The Hush developers"), COPYRIGHT_YEAR)) + "\n" +
|
||||
FormatParagraph(strprintf(_("Copyright (C) 2018-%i The Verus developers"), COPYRIGHT_YEAR)) + "\n" +
|
||||
"\n" +
|
||||
FormatParagraph(_("This is experimental software.")) + "\n" +
|
||||
FormatParagraph(_("This is experimental software!!!")) + "\n" +
|
||||
"\n" +
|
||||
FormatParagraph(_("Distributed under the MIT software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>.")) + "\n" +
|
||||
"\n" +
|
||||
|
||||
@@ -17,14 +17,12 @@ uint16_t ASSETCHAINS_P2PPORT,ASSETCHAINS_RPCPORT;
|
||||
uint32_t ASSETCHAIN_INIT,ASSETCHAINS_CC;
|
||||
uint32_t ASSETCHAINS_MAGIC = 2387029918;
|
||||
uint32_t ASSETCHAINS_EQUIHASH = 0;
|
||||
uint32_t ASSETCHAINS_VERUSHASH = 1;
|
||||
uint32_t ASSETCHAINS_VERUSHASHV1_1 = 2;
|
||||
uint32_t ASSETCHAINS_ALGO = 0;
|
||||
int32_t ASSETCHAINS_LWMAPOS = 0;
|
||||
int32_t VERUS_BLOCK_POSUNITS = 1000;
|
||||
int32_t ASSETCHAINS_OVERWINTER = 227520;
|
||||
int32_t ASSETCHAINS_SAPLING = 227520;
|
||||
int32_t KOMODO_TESTNODE = 0;
|
||||
int32_t KOMODO_BLOCK_POSUNITS = 1000;
|
||||
|
||||
unsigned int MAX_BLOCK_SIGOPS = 20000;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user