diff --git a/.gitignore b/.gitignore index 343cc25..b2cb8c8 100644 --- a/.gitignore +++ b/.gitignore @@ -172,3 +172,4 @@ doc/Doxyfile src/ohmcoin-cli src/ohmcoin-tx src/ohmcoind +doc/Doxyfile diff --git a/README.md b/README.md index 3fd90a1..7b34acf 100755 --- a/README.md +++ b/README.md @@ -1,41 +1,65 @@ -Ohmcoin Core integration/staging repository +OHMCoin Core integration/staging repository ===================================== -[![Build Status](https://travis-ci.org/theohmproject/Ohmcoin.svg?branch=master)](https://travis-ci.org/theohmproject/Ohmcoin) +[![GitHub version](https://badge.fury.io/gh/theohmproject%2Fohmcoin.svg)](https://badge.fury.io/gh/theohmproject%2Fohmcoin) Ohmcoin is a cutting edge cryptocurrency, with many features not available in most other cryptocurrencies. -- Anonymized transactions using zerocoin technology -- 100% Proof of Stake 3.0 Consensus protocol, allowing very low transaction fees and energy expenditure, and staking rewards to all participants in the network -- Karmanode technology used to secure the network and provide the above features, each Karmanode is secured - with collateral of 10K OHMC -- Decentralized blockchain voting utilizing Karmanode technology to form a DAO. The blockchain will distribute monthly treasury funds based on successful proposals submitted by the community and voted on by the DAO. +- Anonymized transactions using coin mixing technology, we call it _Coin Mixing_. +- Fast transactions featuring guaranteed zero confirmation transactions, we call it _FastSend_. +- Decentralized blockchain voting providing for consensus based advancement of the current Karmanode + technology used to secure the network and provide the above features, each Karmanode is secured + with collateral of 3000 OHMC -17.6M ohmcoin was produced for swapping. 500k were mined 1-200 blocks to bring that amount to 18.1M OHMC, the amount needed for the swap. +More information at [ohmcoin.org](http://www.ohmcoin.org) -Since then, the Ohmcoin repository has been rebaselined to show the fork relationship properly. - -## BCT Thread ## +### Coin Specs + + + + + + + + +
Ticker SymbolOHMC
AlgorithmQuark
TypePoW - PoS Hybrid*
Block Time30 Seconds
Difficulty RetargetingEvery Block
Premine/Initial Supply30Mil OHMC*
OHMC Created Per block1 OHMC*
-https://bitcointalk.org/index.php?topic=2307909.0 +*First 1000 Blocks PoW. 1001 - Infinite Blocks PoS only. -Rebrand from KryptKoin [KTK] to Ohmcoin [OHMC] +**30Mil OHMC initial coins Premined to Swap over prior OHMC Block Chain. -## Coin Specs ## +### PoS/PoW Block Details - - - - + +
AlgoQuark
Block Time60 Seconds
Difficulty RetargetingEvery Block
Max Coin Supply (PoS Phase)Infinite
Proof Of Work Phase1-1000 Blocks.
Proof of Stake Phase1001-100 Million
-## PoS Rewards Breakdown ## +### Reward Methods + + + +
KarmanodesYes - 3000 OHMC Required
Wallet StakingYes - 1 to infinite OHMC
+### Staking Reward Details - - - - - + + + + +
Block HeightRewardKarmanodesStakers
<= 755,6007.7 OHMC4.2 OHMC2.8 OHMC
755,601-1,043,9995 OHMC2.7 OHMC1.8 OHMC
1,044,000-1,562,3984 OHMC2.16 OHMC1.44 OHMC
> 1,562,3993 OHMC1.62 OHMC1.08 OHMC
OHMC Produced1 OHMC Per Block
Amount Designated for Rewards100% of OHMC produced goes to Staking Rewards
Rewards AlgorithmSeeSaw Based Targeting System
Amount of Rewards Per Block2 Rewards, 1 for Karmanodes, 1 for Wallet Staking
Coin Maturity to Stake150 Blocks
-The Ohmcoin development budget is up to a maximum of 1 OHMC per block, paid out based on approved proposals as voted on by the Ohmcoin karmanode owners through the community governance process. +### Rewards Breakdown + + + + + + + + + + + + + +
PhaseBlock HeightRewards Created Per BlockRewards Created Per Day
Phase 11000-9043201 OHMC2880 OHMC
Phase 2904321-1336320.5 OHMC1440 OHMC
Phase 31336321-1941121.25 OHMC720 OHMC
Phase 41941122-23731220.125 OHMC360 OHMC
Phase 52373123-29779230.0625 OHMC180 OHMC
Phase 62977924-40291240.03125 OHMC90 OHMC
Phase 74029125-5615990.015625 OHMC45 OHMC
Phase 86131525-82339260.0078125 OHMC22.5 OHMC
Phase 98233927-103363270.00390625 OHMC11.25 OHMC
Phase X10336328-Infinite0.001953125 OHMC5.625 OHMC
diff --git a/configure.ac b/configure.ac index d7e0c4a..9d38faa 100755 --- a/configure.ac +++ b/configure.ac @@ -1,8 +1,8 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N) AC_PREREQ([2.60]) -define(_CLIENT_VERSION_MAJOR, 1) -define(_CLIENT_VERSION_MINOR, 6) -define(_CLIENT_VERSION_REVISION, 1) +define(_CLIENT_VERSION_MAJOR, 3) +define(_CLIENT_VERSION_MINOR, 0) +define(_CLIENT_VERSION_REVISION, 0) define(_CLIENT_VERSION_BUILD, 0) define(_CLIENT_VERSION_IS_RELEASE, true) define(_COPYRIGHT_YEAR, 2019) diff --git a/contrib/bitrpc/bitrpc.py b/contrib/bitrpc/bitrpc.py index 5a8f0d2..7abd4e6 100755 --- a/contrib/bitrpc/bitrpc.py +++ b/contrib/bitrpc/bitrpc.py @@ -11,9 +11,9 @@ if rpcpass == "": - access = ServiceProxy("http://127.0.0.1:11772") + access = ServiceProxy("http://127.0.0.1:52021") else: - access = ServiceProxy("http://"+rpcuser+":"+rpcpass+"@127.0.0.1:11772") + access = ServiceProxy("http://"+rpcuser+":"+rpcpass+"@127.0.0.1:52021") cmd = sys.argv[1].lower() if cmd == "backupwallet": diff --git a/contrib/debian/examples/phore.conf b/contrib/debian/examples/ohmcoin.conf similarity index 99% rename from contrib/debian/examples/phore.conf rename to contrib/debian/examples/ohmcoin.conf index 93039fd..14d7c7f 100644 --- a/contrib/debian/examples/phore.conf +++ b/contrib/debian/examples/ohmcoin.conf @@ -79,7 +79,7 @@ #rpcallowip=2001:db8:85a3:0:0:8a2e:370:7334/96 # Listen for RPC connections on this TCP port: -#rpcport=11772 +#rpcport=52021 # You can use Ohmcoin or ohmcoind to send commands to Ohmcoin/ohmcoind # running on another host using this option: diff --git a/contrib/debian/manpages/phore-qt.1 b/contrib/debian/manpages/ohmcoin-qt.1 similarity index 98% rename from contrib/debian/manpages/phore-qt.1 rename to contrib/debian/manpages/ohmcoin-qt.1 index 882fdf6..22add23 100644 --- a/contrib/debian/manpages/phore-qt.1 +++ b/contrib/debian/manpages/ohmcoin-qt.1 @@ -122,7 +122,7 @@ Username for JSON\-RPC connections Password for JSON\-RPC connections .TP \fB\-rpcport=\fR -Listen for JSON\-RPC connections on (default: 11772 or testnet: 11774) +Listen for JSON\-RPC connections on (default: 52021 or testnet: 11774) .TP \fB\-rpcallowip=\fR Allow JSON\-RPC connections from specified IP address diff --git a/contrib/debian/manpages/phore.conf.5 b/contrib/debian/manpages/ohmcoin.conf.5 similarity index 99% rename from contrib/debian/manpages/phore.conf.5 rename to contrib/debian/manpages/ohmcoin.conf.5 index 5e36689..85bd623 100644 --- a/contrib/debian/manpages/phore.conf.5 +++ b/contrib/debian/manpages/ohmcoin.conf.5 @@ -40,7 +40,7 @@ You must set *rpcpassword* to secure the JSON-RPC api. \fBrpcallowip=\fR\fI'192.168.1.*'\fR By default, only RPC connections from localhost are allowed. Specify as many *rpcallowip=* settings as you like to allow connections from other hosts (and you may use * as a wildcard character). .TP -\fBrpcport=\fR\fI'11772'\fR +\fBrpcport=\fR\fI'52021'\fR Listen for RPC connections on this TCP port. .TP \fBrpcconnect=\fR\fI'127.0.0.1'\fR diff --git a/contrib/debian/manpages/phored.1 b/contrib/debian/manpages/ohmcoind.1 similarity index 100% rename from contrib/debian/manpages/phored.1 rename to contrib/debian/manpages/ohmcoind.1 diff --git a/contrib/debian/phore-qt.desktop b/contrib/debian/ohmcoin-qt.desktop similarity index 100% rename from contrib/debian/phore-qt.desktop rename to contrib/debian/ohmcoin-qt.desktop diff --git a/contrib/debian/phore-qt.install b/contrib/debian/ohmcoin-qt.install similarity index 100% rename from contrib/debian/phore-qt.install rename to contrib/debian/ohmcoin-qt.install diff --git a/contrib/debian/phore-qt.lintian-overrides b/contrib/debian/ohmcoin-qt.lintian-overrides similarity index 100% rename from contrib/debian/phore-qt.lintian-overrides rename to contrib/debian/ohmcoin-qt.lintian-overrides diff --git a/contrib/debian/phore-qt.protocol b/contrib/debian/ohmcoin-qt.protocol similarity index 100% rename from contrib/debian/phore-qt.protocol rename to contrib/debian/ohmcoin-qt.protocol diff --git a/contrib/debian/phored.bash-completion b/contrib/debian/ohmcoind.bash-completion similarity index 100% rename from contrib/debian/phored.bash-completion rename to contrib/debian/ohmcoind.bash-completion diff --git a/contrib/debian/phored.examples b/contrib/debian/ohmcoind.examples similarity index 100% rename from contrib/debian/phored.examples rename to contrib/debian/ohmcoind.examples diff --git a/contrib/debian/phored.install b/contrib/debian/ohmcoind.install similarity index 100% rename from contrib/debian/phored.install rename to contrib/debian/ohmcoind.install diff --git a/contrib/debian/phored.lintian-overrides b/contrib/debian/ohmcoind.lintian-overrides similarity index 100% rename from contrib/debian/phored.lintian-overrides rename to contrib/debian/ohmcoind.lintian-overrides diff --git a/contrib/debian/phored.manpages b/contrib/debian/ohmcoind.manpages similarity index 100% rename from contrib/debian/phored.manpages rename to contrib/debian/ohmcoind.manpages diff --git a/contrib/init/phored.conf b/contrib/init/ohmcoind.conf similarity index 100% rename from contrib/init/phored.conf rename to contrib/init/ohmcoind.conf diff --git a/contrib/init/phored.init b/contrib/init/ohmcoind.init similarity index 100% rename from contrib/init/phored.init rename to contrib/init/ohmcoind.init diff --git a/contrib/init/phored.openrc b/contrib/init/ohmcoind.openrc similarity index 100% rename from contrib/init/phored.openrc rename to contrib/init/ohmcoind.openrc diff --git a/contrib/init/phored.openrcconf b/contrib/init/ohmcoind.openrcconf similarity index 100% rename from contrib/init/phored.openrcconf rename to contrib/init/ohmcoind.openrcconf diff --git a/contrib/init/phored.service b/contrib/init/ohmcoind.service.app similarity index 100% rename from contrib/init/phored.service rename to contrib/init/ohmcoind.service.app diff --git a/contrib/linearize/linearize-hashes.py b/contrib/linearize/linearize-hashes.py index e446c5d..caf3491 100755 --- a/contrib/linearize/linearize-hashes.py +++ b/contrib/linearize/linearize-hashes.py @@ -96,7 +96,7 @@ def get_block_hashes(settings, max_blocks_per_call=10000): if 'host' not in settings: settings['host'] = '127.0.0.1' if 'port' not in settings: - settings['port'] = 11772 + settings['port'] = 52021 if 'min_height' not in settings: settings['min_height'] = 0 if 'max_height' not in settings: diff --git a/contrib/spendfrom/spendfrom.py b/contrib/spendfrom/spendfrom.py index 3a8f815..8d1e2f3 100755 --- a/contrib/spendfrom/spendfrom.py +++ b/contrib/spendfrom/spendfrom.py @@ -67,7 +67,7 @@ def connect_JSON(config): testnet = config.get('testnet', '0') testnet = (int(testnet) > 0) # 0/1 in config file, convert to True/False if not 'rpcport' in config: - config['rpcport'] = 11774 if testnet else 11772 + config['rpcport'] = 11774 if testnet else 52021 connect = "http://%s:%s@127.0.0.1:%s"%(config['rpcuser'], config['rpcpassword'], config['rpcport']) try: result = ServiceProxy(connect) diff --git a/doc/Doxyfile b/doc/Doxyfile old mode 100755 new mode 100644 index 5253d62..203b649 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = "Ohmcoin Core" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.3.3 +PROJECT_NUMBER = 3.0.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/doc/karmanode-budget.md b/doc/karmanode-budget.md index aea096e..34f9920 100644 --- a/doc/karmanode-budget.md +++ b/doc/karmanode-budget.md @@ -16,11 +16,11 @@ Budgets go through a series of stages before being paid: Prepare collateral transaction ------------------------ -mnbudget prepare \ \ \ \ \ \ [use_ix(true|false)] +knbudget prepare \ \ \ \ \ \ [use_ix(true|false)] Example: ``` -mnbudget prepare cool-project http://www.cool-project/one.json 12 100000 y6R9oN12KnB9zydzTLc3LikD9cCjjQzYG7 1200 true +knbudget prepare cool-project http://www.cool-project/one.json 12 100000 y6R9oN12KnB9zydzTLc3LikD9cCjjQzYG7 1200 true ``` Output: `464a0eb70ea91c94295214df48c47baa72b3876cfb658744aaf863c7b5bf1ff0` - This is the collateral hash, copy this output for the next step @@ -32,11 +32,11 @@ In this transaction we prepare collateral for "_cool-project_". This proposal wi Submit proposal to network ------------------------ -mnbudget submit \ \ \ \ \ \ \ +knbudget submit \ \ \ \ \ \ \ Example: ``` -mnbudget submit cool-project http://www.cool-project/one.json 12 100000 y6R9oN12KnB9zydzTLc3LikD9cCjjQzYG7 1200 464a0eb70ea91c94295214df48c47baa72b3876cfb658744aaf863c7b5bf1ff0 +knbudget submit cool-project http://www.cool-project/one.json 12 100000 y6R9oN12KnB9zydzTLc3LikD9cCjjQzYG7 1200 464a0eb70ea91c94295214df48c47baa72b3876cfb658744aaf863c7b5bf1ff0 ``` Output: `a2b29778ae82e45a973a94309ffa6aa2e2388b8f95b39ab3739f0078835f0491` - This is your proposal hash, which other nodes will use to vote on it @@ -46,11 +46,11 @@ Lobby for votes Double check your information: -mnbudget getinfo \ +knbudget getinfo \ Example: ``` -mnbudget getinfo cool-project +knbudget getinfo cool-project ``` Output: ``` @@ -77,11 +77,11 @@ Output: If everything looks correct, you can ask for votes from other karmanodes. To vote on a proposal, load a wallet with _karmanode.conf_ file. You do not need to access your cold wallet to vote for proposals. -mnbudget vote \ [yes|no] +knbudget vote \ [yes|no] Example: ``` -mnbudget vote a2b29778ae82e45a973a94309ffa6aa2e2388b8f95b39ab3739f0078835f0491 yes +knbudget vote a2b29778ae82e45a973a94309ffa6aa2e2388b8f95b39ab3739f0078835f0491 yes ``` Output: `Voted successfully` - Your vote has been submitted and accepted. @@ -89,11 +89,11 @@ Output: `Voted successfully` - Your vote has been submitted and accepted. Make it into the budget ------------------------ -After you get enough votes, execute `mnbudget projection` to see if you made it into the budget. If you the budget was finalized at this moment which proposals would be in it. Note: Proposals must be active at least 1 day on the network and receive 10% of the karmanode network in yes votes in order to qualify (E.g. if there is 2500 karmanodes, you will need 250 yes votes.) +After you get enough votes, execute `knbudget projection` to see if you made it into the budget. If you the budget was finalized at this moment which proposals would be in it. Note: Proposals must be active at least 1 day on the network and receive 10% of the karmanode network in yes votes in order to qualify (E.g. if there is 2500 karmanodes, you will need 250 yes votes.) Example: ``` -mnbudget projection +knbudget projection ``` Output: @@ -145,7 +145,7 @@ RPC Commands ------------------------ The following new RPC commands are supported: -- mnbudget "command"... ( "passphrase" ) +- knbudget "command"... ( "passphrase" ) * prepare - Prepare proposal for network by signing and creating tx * submit - Submit proposal for network * vote-many - Vote on a Ohmcoin initiative @@ -157,7 +157,7 @@ The following new RPC commands are supported: * projection - Show the projection of which proposals will be paid the next cycle * check - Scan proposals and remove invalid -- mnfinalbudget "command"... ( "passphrase" ) +- knfinalbudget "command"... ( "passphrase" ) * vote-many - Vote on a finalized budget * vote - Vote on a finalized budget * show - Show existing finalized budgets diff --git a/doc/release-notes/phore/release-notes-1.2.1.md b/doc/release-notes/ohmcoin/release-notes-1.2.1.md similarity index 100% rename from doc/release-notes/phore/release-notes-1.2.1.md rename to doc/release-notes/ohmcoin/release-notes-1.2.1.md diff --git a/doc/release-notes/phore/release-notes-1.2.2.md b/doc/release-notes/ohmcoin/release-notes-1.2.2.md similarity index 100% rename from doc/release-notes/phore/release-notes-1.2.2.md rename to doc/release-notes/ohmcoin/release-notes-1.2.2.md diff --git a/doc/release-notes/phore/release-notes-1.3.0.md b/doc/release-notes/ohmcoin/release-notes-1.3.0.md similarity index 100% rename from doc/release-notes/phore/release-notes-1.3.0.md rename to doc/release-notes/ohmcoin/release-notes-1.3.0.md diff --git a/doc/release-notes/phore/release-notes-1.3.1.md b/doc/release-notes/ohmcoin/release-notes-1.3.1.md similarity index 100% rename from doc/release-notes/phore/release-notes-1.3.1.md rename to doc/release-notes/ohmcoin/release-notes-1.3.1.md diff --git a/doc/release-notes/release-notes-2.3.0.md b/doc/release-notes/release-notes-2.3.0.md index 194263f..cd09fb7 100644 --- a/doc/release-notes/release-notes-2.3.0.md +++ b/doc/release-notes/release-notes-2.3.0.md @@ -101,11 +101,11 @@ For the `list` (aka `karmanodelist`) parameter, the various "modes" have been re ] ``` -#### mnbudget command +#### knbudget command -An additional parameter has been added to `mnbudget` to allow a controller wallet to issue per-MN votes. The new parameter is `vote-alias` and it's use format is as follows: +An additional parameter has been added to `knbudget` to allow a controller wallet to issue per-MN votes. The new parameter is `vote-alias` and it's use format is as follows: -`mnbudget vote-alias ` +`knbudget vote-alias ` All fields are required to successfully vote. diff --git a/doc/release-notes/release-notes-2.3.1.md b/doc/release-notes/release-notes-2.3.1.md index 59eae3e..fd31a15 100644 --- a/doc/release-notes/release-notes-2.3.1.md +++ b/doc/release-notes/release-notes-2.3.1.md @@ -56,17 +56,17 @@ RPC changes | `karmanode create` | | removed - not implemented | | `karmanode calcscore` | `listkarmanodescores` | | | --- | --- | --- | -| `mnbudget prepare` | `preparebudget` | see notes below | -| `mnbudget submit` | `submitbudget` | see notes below | -| `mnbudget vote-many` | `mnbudgetvote` | see notes below | -| `mnbudget vote-alias` | `mnbudgetvote` | see notes below | -| `mnbudget vote` | `mnbudgetvote` | see notes below | -| `mnbudget getvotes` | `getbudgetvotes` | | -| `mnbudget getinfo` | `getbudgetinfo` | see notes below | -| `mnbudget show` | `getbudgetinfo` | see notes below | -| `mnbudget projection` | `getbudgetprojection` | | -| `mnbudget check` | `checkbudgets` | | -| `mnbudget nextblock` | `getnextsuperblock` | | +| `knbudget prepare` | `preparebudget` | see notes below | +| `knbudget submit` | `submitbudget` | see notes below | +| `knbudget vote-many` | `knbudgetvote` | see notes below | +| `knbudget vote-alias` | `knbudgetvote` | see notes below | +| `knbudget vote` | `knbudgetvote` | see notes below | +| `knbudget getvotes` | `getbudgetvotes` | | +| `knbudget getinfo` | `getbudgetinfo` | see notes below | +| `knbudget show` | `getbudgetinfo` | see notes below | +| `knbudget projection` | `getbudgetprojection` | | +| `knbudget check` | `checkbudgets` | | +| `knbudget nextblock` | `getnextsuperblock` | | ##### `startkarmanode` Command ##### This command now handles all cases for starting a karmanode instead of having multiple commands based on the context. Command arguments have changed slightly to allow the user to decide wither or not to re-lock the wallet after the command is run. Below is the help documentation: @@ -105,11 +105,11 @@ Examples: ##### `preparebudget` & `submitbudget` Commands ##### Due to the requirement of maintaining backwards compatibility with the legacy command, these two new commands are created to handle the preparation/submission of budget proposals. Future intention is to roll these two commands back into a single command to reduce code-duplication. Paramater arguments currently remain unchanged from the legacy command equivilent. -##### `mnbudgetvote` Command ##### -This command now handles all cases for submitting MN votes on a budget proposal. Backwards compatibility with the legacy command(s) has been retained, with the exception of the `vote-alias` case due to a conflict in paramater type casting. A user running `mnbudget vote-alias` will be instructed to instead use the new `mnvote` command. Below is the full help documentation for this new command: +##### `knbudgetvote` Command ##### +This command now handles all cases for submitting MN votes on a budget proposal. Backwards compatibility with the legacy command(s) has been retained, with the exception of the `vote-alias` case due to a conflict in paramater type casting. A user running `knbudget vote-alias` will be instructed to instead use the new `mnvote` command. Below is the full help documentation for this new command: ``` -mnbudgetvote "local|many|alias" "votehash" "yes|no" ( "alias" ) +knbudgetvote "local|many|alias" "votehash" "yes|no" ( "alias" ) Vote on a budget proposal @@ -133,12 +133,12 @@ Result: } Examples: -> pivx-cli mnbudgetvote "local" "ed2f83cedee59a91406f5f47ec4d60bf5a7f9ee6293913c82976bd2d3a658041" "yes" -> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "mnbudgetvote", "params": ["local" "ed2f83cedee59a91406f5f47ec4d60bf5a7f9ee6293913c82976bd2d3a658041" "yes"] }' -H 'content-type: text/plain;' http://127.0.0.1:51473/ +> pivx-cli knbudgetvote "local" "ed2f83cedee59a91406f5f47ec4d60bf5a7f9ee6293913c82976bd2d3a658041" "yes" +> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "knbudgetvote", "params": ["local" "ed2f83cedee59a91406f5f47ec4d60bf5a7f9ee6293913c82976bd2d3a658041" "yes"] }' -H 'content-type: text/plain;' http://127.0.0.1:51473/ ``` ##### `getbudgetinfo` Command ##### -This command now combines the old `mnbudget show` and `mnbudget getinfo` commands to reduce code duplication while still maintaining backwards compatibility with the legacy commands. Given no parameters, it returns the full list of budget proposals (`mnbudget show`). A single optional parameter allows to return information on just that proposal (`mnbudget getinfo`). Below is the full help documentation: +This command now combines the old `knbudget show` and `knbudget getinfo` commands to reduce code duplication while still maintaining backwards compatibility with the legacy commands. Given no parameters, it returns the full list of budget proposals (`knbudget show`). A single optional parameter allows to return information on just that proposal (`knbudget getinfo`). Below is the full help documentation: ``` getbudgetinfo ( "proposal" ) diff --git a/doc/swifttx.md b/doc/swifttx.md index 2c8a427..c4c44fd 100755 --- a/doc/swifttx.md +++ b/doc/swifttx.md @@ -11,9 +11,9 @@ When a "Transaction Lock" occurs the hash of the related transaction is broadcas * `zmqpubrawtxlock`: publishes the raw transaction when locked via SwiftX * `zmqpubhashtxlock`: publishes the transaction hash when locked via SwiftX -This mechanism has been integrated into Bitcore-Node-PHore which allows for notification to be broadcast through Insight API in one of two ways: -* WebSocket: [https://github.com/theohmproject/insight-api-ohmcoin#web-socket-api](https://github.com/theohmproject/insight-api-ohmcoin#web-socket-api) -* API: [https://github.com/theohmproject/insight-api-ohmcoin#swifttx-transactions](https://github.com/theohmproject/insight-api-ohmcoin#swifttx-transactions) +This mechanism has been integrated into Bitcore-Node-Ohmocoin which allows for notification to be broadcast through Insight API in one of two ways: +* WebSocket: [https://github.com/theohmproject/insight-api-ohmcoin#web-socket-api](https://github.com/theohmproject/insight-api-ohmcoin#web-socket-api) +* API: [https://github.com/theohmproject/insight-api-ohmcoin#swifttx-transactions](https://github.com/theohmproject/insight-api-ohmcoin#swifttx-transactions) ####Command line option diff --git a/src/init.cpp b/src/init.cpp index 52a7c68..a822239 100755 --- a/src/init.cpp +++ b/src/init.cpp @@ -481,7 +481,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += HelpMessageOpt("-stopafterblockimport", strprintf(_("Stop running after importing blocks from disk (default: %u)"), 0)); strUsage += HelpMessageOpt("-sporkkey=", _("Enable spork administration functionality with the appropriate private key.")); } - string debugCategories = "addrman, alert, bench, coindb, db, lock, rand, rpc, selectcoins, tor, mempool, net, proxy, http, libevent, ohmcoin, (obfuscation, swiftx, karmanode, mnpayments, mnbudget, zero)"; // Don't translate these and qt below + string debugCategories = "addrman, alert, bench, coindb, db, lock, rand, rpc, selectcoins, tor, mempool, net, proxy, http, libevent, ohmcoin, (obfuscation, swiftx, karmanode, mnpayments, knbudget, zero)"; // Don't translate these and qt below if (mode == HMM_BITCOIN_QT) debugCategories += ", qt"; strUsage += HelpMessageOpt("-debug=", strprintf(_("Output debugging information (default: %u, supplying is optional)"), 0) + ". " + @@ -565,7 +565,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += HelpMessageOpt("-rpccookiefile=", _("Location of the auth cookie (default: data dir)")); strUsage += HelpMessageOpt("-rpcuser=", _("Username for JSON-RPC connections")); strUsage += HelpMessageOpt("-rpcpassword=", _("Password for JSON-RPC connections")); - strUsage += HelpMessageOpt("-rpcport=", strprintf(_("Listen for JSON-RPC connections on (default: %u or testnet: %u)"), 11772, 11774)); + strUsage += HelpMessageOpt("-rpcport=", strprintf(_("Listen for JSON-RPC connections on (default: %u or testnet: %u)"), 52021, 11774)); strUsage += HelpMessageOpt("-rpcallowip=", _("Allow JSON-RPC connections from specified source. Valid for are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times")); strUsage += HelpMessageOpt("-rpcserialversion=", strprintf(_("Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)"), DEFAULT_RPC_SERIALIZE_VERSION)); strUsage += HelpMessageOpt("-rpcthreads=", strprintf(_("Set the number of threads to service RPC calls (default: %d)"), DEFAULT_HTTP_THREADS)); diff --git a/src/karmanode-budget.cpp b/src/karmanode-budget.cpp index 36c4f77..2b1a3f7 100755 --- a/src/karmanode-budget.cpp +++ b/src/karmanode-budget.cpp @@ -49,7 +49,7 @@ bool IsBudgetCollateralValid(uint256 nTxCollateralHash, uint256 nExpectedHash, s uint256 nBlockHash; if (!GetTransaction(nTxCollateralHash, txCollateral, nBlockHash, true)) { strError = strprintf("Can't find collateral tx %s", txCollateral.ToString()); - LogPrint("mnbudget","CBudgetProposalBroadcast::IsBudgetCollateralValid - %s\n", strError); + LogPrint("knbudget","CBudgetProposalBroadcast::IsBudgetCollateralValid - %s\n", strError); return false; } @@ -63,16 +63,16 @@ bool IsBudgetCollateralValid(uint256 nTxCollateralHash, uint256 nExpectedHash, s BOOST_FOREACH (const CTxOut o, txCollateral.vout) { if (!o.scriptPubKey.IsNormalPaymentScript() && !o.scriptPubKey.IsUnspendable()) { strError = strprintf("Invalid Script %s", txCollateral.ToString()); - LogPrint("mnbudget","CBudgetProposalBroadcast::IsBudgetCollateralValid - %s\n", strError); + LogPrint("knbudget","CBudgetProposalBroadcast::IsBudgetCollateralValid - %s\n", strError); return false; } if (fBudgetFinalization) { // Collateral for budget finalization // Note: there are still old valid budgets out there, but the check for the new 25 OHMC finalization collateral // will also cover the old 50 OHMC finalization collateral. - LogPrint("mnbudget", "Final Budget: o.scriptPubKey(%s) == findScript(%s) ?\n", o.scriptPubKey.ToString(), findScript.ToString()); + LogPrint("knbudget", "Final Budget: o.scriptPubKey(%s) == findScript(%s) ?\n", o.scriptPubKey.ToString(), findScript.ToString()); if (o.scriptPubKey == findScript) { - LogPrint("mnbudget", "Final Budget: o.nValue(%ld) >= BUDGET_FEE_TX(%ld) ?\n", o.nValue, GetBudgetSystemCollateralAmount(chainActive.Height())); + LogPrint("knbudget", "Final Budget: o.nValue(%ld) >= BUDGET_FEE_TX(%ld) ?\n", o.nValue, GetBudgetSystemCollateralAmount(chainActive.Height())); if(o.nValue >= GetBudgetSystemCollateralAmount(chainActive.Height())) { foundOpReturn = true; } @@ -80,9 +80,9 @@ bool IsBudgetCollateralValid(uint256 nTxCollateralHash, uint256 nExpectedHash, s } else { // Collateral for normal budget proposal - LogPrint("mnbudget", "Normal Budget: o.scriptPubKey(%s) == findScript(%s) ?\n", o.scriptPubKey.ToString(), findScript.ToString()); + LogPrint("knbudget", "Normal Budget: o.scriptPubKey(%s) == findScript(%s) ?\n", o.scriptPubKey.ToString(), findScript.ToString()); if (o.scriptPubKey == findScript) { - LogPrint("mnbudget", "Normal Budget: o.nValue(%ld) >= PROPOSAL_FEE_TX(%ld) ?\n", o.nValue, GetBudgetSystemCollateralAmount(chainActive.Height())); + LogPrint("knbudget", "Normal Budget: o.nValue(%ld) >= PROPOSAL_FEE_TX(%ld) ?\n", o.nValue, GetBudgetSystemCollateralAmount(chainActive.Height())); if(o.nValue >= GetBudgetSystemCollateralAmount(chainActive.Height())) { foundOpReturn = true; } @@ -91,7 +91,7 @@ bool IsBudgetCollateralValid(uint256 nTxCollateralHash, uint256 nExpectedHash, s } if (!foundOpReturn) { strError = strprintf("Couldn't find opReturn %s in %s", nExpectedHash.ToString(), txCollateral.ToString()); - LogPrint("mnbudget","CBudgetProposalBroadcast::IsBudgetCollateralValid - %s\n", strError); + LogPrint("knbudget","CBudgetProposalBroadcast::IsBudgetCollateralValid - %s\n", strError); return false; } @@ -120,7 +120,7 @@ bool IsBudgetCollateralValid(uint256 nTxCollateralHash, uint256 nExpectedHash, s return true; } else { strError = strprintf("Collateral requires at least %d confirmations - %d confirmations", Params().BudgetFeeConfirmations(), conf); - LogPrint("mnbudget","CBudgetProposalBroadcast::IsBudgetCollateralValid - %s - %d confirmations\n", strError, conf); + LogPrint("knbudget","CBudgetProposalBroadcast::IsBudgetCollateralValid - %s - %d confirmations\n", strError, conf); return false; } } @@ -134,7 +134,7 @@ void CBudgetManager::CheckOrphanVotes() std::map::iterator it1 = mapOrphanKarmanodeBudgetVotes.begin(); while (it1 != mapOrphanKarmanodeBudgetVotes.end()) { if (budget.UpdateProposal(((*it1).second), NULL, strError)) { - LogPrint("mnbudget","CBudgetManager::CheckOrphanVotes - Proposal/Budget is known, activating and removing orphan vote\n"); + LogPrint("knbudget","CBudgetManager::CheckOrphanVotes - Proposal/Budget is known, activating and removing orphan vote\n"); mapOrphanKarmanodeBudgetVotes.erase(it1++); } else { ++it1; @@ -143,13 +143,13 @@ void CBudgetManager::CheckOrphanVotes() std::map::iterator it2 = mapOrphanFinalizedBudgetVotes.begin(); while (it2 != mapOrphanFinalizedBudgetVotes.end()) { if (budget.UpdateFinalizedBudget(((*it2).second), NULL, strError)) { - LogPrint("mnbudget","CBudgetManager::CheckOrphanVotes - Proposal/Budget is known, activating and removing orphan vote\n"); + LogPrint("knbudget","CBudgetManager::CheckOrphanVotes - Proposal/Budget is known, activating and removing orphan vote\n"); mapOrphanFinalizedBudgetVotes.erase(it2++); } else { ++it2; } } - LogPrint("mnbudget","CBudgetManager::CheckOrphanVotes - Done\n"); + LogPrint("knbudget","CBudgetManager::CheckOrphanVotes - Done\n"); } void CBudgetManager::SubmitFinalBudget() @@ -166,7 +166,7 @@ void CBudgetManager::SubmitFinalBudget() int nBlockStart = nCurrentHeight - nCurrentHeight % GetBudgetPaymentCycleBlocks() + GetBudgetPaymentCycleBlocks(); if (nSubmittedHeight >= nBlockStart){ - LogPrint("mnbudget","CBudgetManager::SubmitFinalBudget - nSubmittedHeight(=%ld) < nBlockStart(=%ld) condition not fulfilled.\n", nSubmittedHeight, nBlockStart); + LogPrint("knbudget","CBudgetManager::SubmitFinalBudget - nSubmittedHeight(=%ld) < nBlockStart(=%ld) condition not fulfilled.\n", nSubmittedHeight, nBlockStart); return; } @@ -184,8 +184,8 @@ void CBudgetManager::SubmitFinalBudget() int nOffsetToStart = nFinalizationStart - nCurrentHeight; if (nBlockStart - nCurrentHeight > finalizationWindow){ - LogPrint("mnbudget","CBudgetManager::SubmitFinalBudget - Too early for finalization. Current block is %ld, next Superblock is %ld.\n", nCurrentHeight, nBlockStart); - LogPrint("mnbudget","CBudgetManager::SubmitFinalBudget - First possible block for finalization: %ld. Last possible block for finalization: %ld. You have to wait for %ld block(s) until Budget finalization will be possible\n", nFinalizationStart, nBlockStart, nOffsetToStart); + LogPrint("knbudget","CBudgetManager::SubmitFinalBudget - Too early for finalization. Current block is %ld, next Superblock is %ld.\n", nCurrentHeight, nBlockStart); + LogPrint("knbudget","CBudgetManager::SubmitFinalBudget - First possible block for finalization: %ld. Last possible block for finalization: %ld. You have to wait for %ld block(s) until Budget finalization will be possible\n", nFinalizationStart, nBlockStart, nOffsetToStart); return; } @@ -203,13 +203,13 @@ void CBudgetManager::SubmitFinalBudget() } if (vecTxBudgetPayments.size() < 1) { - LogPrint("mnbudget","CBudgetManager::SubmitFinalBudget - Found No Proposals For Period\n"); + LogPrint("knbudget","CBudgetManager::SubmitFinalBudget - Found No Proposals For Period\n"); return; } CFinalizedBudgetBroadcast tempBudget(strBudgetName, nBlockStart, vecTxBudgetPayments, 0); if (mapSeenFinalizedBudgets.count(tempBudget.GetHash())) { - LogPrint("mnbudget","CBudgetManager::SubmitFinalBudget - Budget already exists - %s\n", tempBudget.GetHash().ToString()); + LogPrint("knbudget","CBudgetManager::SubmitFinalBudget - Budget already exists - %s\n", tempBudget.GetHash().ToString()); nSubmittedHeight = nCurrentHeight; return; //already exists } @@ -221,7 +221,7 @@ void CBudgetManager::SubmitFinalBudget() if (!mapCollateralTxids.count(tempBudget.GetHash())) { CWalletTx wtx; if (!pwalletMain->GetBudgetSystemCollateralTX(wtx, tempBudget.GetHash(), false)) { - LogPrint("mnbudget","CBudgetManager::SubmitFinalBudget - Can't make collateral transaction\n"); + LogPrint("knbudget","CBudgetManager::SubmitFinalBudget - Can't make collateral transaction\n"); return; } @@ -241,7 +241,7 @@ void CBudgetManager::SubmitFinalBudget() uint256 nBlockHash; if (!GetTransaction(txidCollateral, txCollateral, nBlockHash, true)) { - LogPrint("mnbudget","CBudgetManager::SubmitFinalBudget - Can't find collateral tx %s", txidCollateral.ToString()); + LogPrint("knbudget","CBudgetManager::SubmitFinalBudget - Can't find collateral tx %s", txidCollateral.ToString()); return; } @@ -260,7 +260,7 @@ void CBudgetManager::SubmitFinalBudget() -- This function is tied to NewBlock, so we will propagate this budget while the block is also propagating */ if (conf < Params().BudgetFeeConfirmations() + 1) { - LogPrint("mnbudget","CBudgetManager::SubmitFinalBudget - Collateral requires at least %d confirmations - %s - %d confirmations\n", Params().BudgetFeeConfirmations() + 1, txidCollateral.ToString(), conf); + LogPrint("knbudget","CBudgetManager::SubmitFinalBudget - Collateral requires at least %d confirmations - %s - %d confirmations\n", Params().BudgetFeeConfirmations() + 1, txidCollateral.ToString(), conf); return; } @@ -269,7 +269,7 @@ void CBudgetManager::SubmitFinalBudget() std::string strError = ""; if (!finalizedBudgetBroadcast.IsValid(strError)) { - LogPrint("mnbudget","CBudgetManager::SubmitFinalBudget - Invalid finalized budget - %s \n", strError); + LogPrint("knbudget","CBudgetManager::SubmitFinalBudget - Invalid finalized budget - %s \n", strError); return; } @@ -278,7 +278,7 @@ void CBudgetManager::SubmitFinalBudget() finalizedBudgetBroadcast.Relay(); budget.AddFinalizedBudget(finalizedBudgetBroadcast); nSubmittedHeight = nCurrentHeight; - LogPrint("mnbudget","CBudgetManager::SubmitFinalBudget - Done! %s\n", finalizedBudgetBroadcast.GetHash().ToString()); + LogPrint("knbudget","CBudgetManager::SubmitFinalBudget - Done! %s\n", finalizedBudgetBroadcast.GetHash().ToString()); } // @@ -319,7 +319,7 @@ bool CBudgetDB::Write(const CBudgetManager& objToSave) } fileout.fclose(); - LogPrint("mnbudget","Written info to budget.dat %dms\n", GetTimeMillis() - nStart); + LogPrint("knbudget","Written info to budget.dat %dms\n", GetTimeMillis() - nStart); return true; } @@ -397,13 +397,13 @@ CBudgetDB::ReadResult CBudgetDB::Read(CBudgetManager& objToLoad, bool fDryRun) return IncorrectFormat; } - LogPrint("mnbudget","Loaded info from budget.dat %dms\n", GetTimeMillis() - nStart); - LogPrint("mnbudget"," %s\n", objToLoad.ToString()); + LogPrint("knbudget","Loaded info from budget.dat %dms\n", GetTimeMillis() - nStart); + LogPrint("knbudget"," %s\n", objToLoad.ToString()); if (!fDryRun) { - LogPrint("mnbudget","Budget manager - cleaning....\n"); + LogPrint("knbudget","Budget manager - cleaning....\n"); objToLoad.CheckAndRemove(); - LogPrint("mnbudget","Budget manager - result:\n"); - LogPrint("mnbudget"," %s\n", objToLoad.ToString()); + LogPrint("knbudget","Budget manager - result:\n"); + LogPrint("knbudget"," %s\n", objToLoad.ToString()); } return Ok; @@ -416,24 +416,24 @@ void DumpBudgets() CBudgetDB budgetdb; CBudgetManager tempBudget; - LogPrint("mnbudget","Verifying budget.dat format...\n"); + LogPrint("knbudget","Verifying budget.dat format...\n"); CBudgetDB::ReadResult readResult = budgetdb.Read(tempBudget, true); // there was an error and it was not an error on file opening => do not proceed if (readResult == CBudgetDB::FileError) - LogPrint("mnbudget","Missing budgets file - budget.dat, will try to recreate\n"); + LogPrint("knbudget","Missing budgets file - budget.dat, will try to recreate\n"); else if (readResult != CBudgetDB::Ok) { - LogPrint("mnbudget","Error reading budget.dat: "); + LogPrint("knbudget","Error reading budget.dat: "); if (readResult == CBudgetDB::IncorrectFormat) - LogPrint("mnbudget","magic is ok but data has invalid format, will try to recreate\n"); + LogPrint("knbudget","magic is ok but data has invalid format, will try to recreate\n"); else { - LogPrint("mnbudget","file format is unknown or invalid, please fix it manually\n"); + LogPrint("knbudget","file format is unknown or invalid, please fix it manually\n"); return; } } - LogPrint("mnbudget","Writting info to budget.dat...\n"); + LogPrint("knbudget","Writting info to budget.dat...\n"); budgetdb.Write(budget); - LogPrint("mnbudget","Budget dump finished %dms\n", GetTimeMillis() - nStart); + LogPrint("knbudget","Budget dump finished %dms\n", GetTimeMillis() - nStart); } bool CBudgetManager::AddFinalizedBudget(CFinalizedBudget& finalizedBudget) @@ -454,7 +454,7 @@ bool CBudgetManager::AddProposal(CBudgetProposal& budgetProposal) LOCK(cs); std::string strError = ""; if (!budgetProposal.IsValid(strError)) { - LogPrint("mnbudget","CBudgetManager::AddProposal - invalid budget proposal - %s\n", strError); + LogPrint("knbudget","CBudgetManager::AddProposal - invalid budget proposal - %s\n", strError); return false; } @@ -463,7 +463,7 @@ bool CBudgetManager::AddProposal(CBudgetProposal& budgetProposal) } mapProposals.insert(make_pair(budgetProposal.GetHash(), budgetProposal)); - LogPrint("mnbudget","CBudgetManager::AddProposal - proposal %s added\n", budgetProposal.GetName ().c_str ()); + LogPrint("knbudget","CBudgetManager::AddProposal - proposal %s added\n", budgetProposal.GetName ().c_str ()); return true; } @@ -482,24 +482,24 @@ void CBudgetManager::CheckAndRemove() } } - LogPrint("mnbudget", "CBudgetManager::CheckAndRemove at Height=%d\n", nHeight); + LogPrint("knbudget", "CBudgetManager::CheckAndRemove at Height=%d\n", nHeight); map tmpMapFinalizedBudgets; map tmpMapProposals; std::string strError = ""; - LogPrint("mnbudget", "CBudgetManager::CheckAndRemove - mapFinalizedBudgets cleanup - size before: %d\n", mapFinalizedBudgets.size()); + LogPrint("knbudget", "CBudgetManager::CheckAndRemove - mapFinalizedBudgets cleanup - size before: %d\n", mapFinalizedBudgets.size()); std::map::iterator it = mapFinalizedBudgets.begin(); while (it != mapFinalizedBudgets.end()) { CFinalizedBudget* pfinalizedBudget = &((*it).second); pfinalizedBudget->fValid = pfinalizedBudget->IsValid(strError); if (!strError.empty ()) { - LogPrint("mnbudget","CBudgetManager::CheckAndRemove - Invalid finalized budget: %s\n", strError); + LogPrint("knbudget","CBudgetManager::CheckAndRemove - Invalid finalized budget: %s\n", strError); } else { - LogPrint("mnbudget","CBudgetManager::CheckAndRemove - Found valid finalized budget: %s %s\n", + LogPrint("knbudget","CBudgetManager::CheckAndRemove - Found valid finalized budget: %s %s\n", pfinalizedBudget->strBudgetName.c_str(), pfinalizedBudget->nFeeTXHash.ToString().c_str()); } @@ -511,17 +511,17 @@ void CBudgetManager::CheckAndRemove() ++it; } - LogPrint("mnbudget", "CBudgetManager::CheckAndRemove - mapProposals cleanup - size before: %d\n", mapProposals.size()); + LogPrint("knbudget", "CBudgetManager::CheckAndRemove - mapProposals cleanup - size before: %d\n", mapProposals.size()); std::map::iterator it2 = mapProposals.begin(); while (it2 != mapProposals.end()) { CBudgetProposal* pbudgetProposal = &((*it2).second); pbudgetProposal->fValid = pbudgetProposal->IsValid(strError); if (!strError.empty ()) { - LogPrint("mnbudget","CBudgetManager::CheckAndRemove - Invalid budget proposal - %s\n", strError); + LogPrint("knbudget","CBudgetManager::CheckAndRemove - Invalid budget proposal - %s\n", strError); strError = ""; } else { - LogPrint("mnbudget","CBudgetManager::CheckAndRemove - Found valid budget proposal: %s %s\n", + LogPrint("knbudget","CBudgetManager::CheckAndRemove - Found valid budget proposal: %s %s\n", pbudgetProposal->strProposalName.c_str(), pbudgetProposal->nFeeTXHash.ToString().c_str()); } if (pbudgetProposal->fValid) { @@ -534,9 +534,9 @@ void CBudgetManager::CheckAndRemove() mapFinalizedBudgets.swap(tmpMapFinalizedBudgets); mapProposals.swap(tmpMapProposals); - LogPrint("mnbudget", "CBudgetManager::CheckAndRemove - mapFinalizedBudgets cleanup - size after: %d\n", mapFinalizedBudgets.size()); - LogPrint("mnbudget", "CBudgetManager::CheckAndRemove - mapProposals cleanup - size after: %d\n", mapProposals.size()); - LogPrint("mnbudget","CBudgetManager::CheckAndRemove - PASSED\n"); + LogPrint("knbudget", "CBudgetManager::CheckAndRemove - mapFinalizedBudgets cleanup - size after: %d\n", mapFinalizedBudgets.size()); + LogPrint("knbudget", "CBudgetManager::CheckAndRemove - mapProposals cleanup - size after: %d\n", mapProposals.size()); + LogPrint("knbudget","CBudgetManager::CheckAndRemove - PASSED\n"); } @@ -577,10 +577,10 @@ void CBudgetManager::FillBlockPayee(CMutableTransaction& txNew, CAmount nFees, b CTxDestination address1; ExtractDestination(payee, address1); - LogPrint("mnbudget","CBudgetManager::FillBlockPayee - Budget payment to %s for %lld, nHighestCount = %d\n", EncodeDestination(address1), nAmount, nHighestCount); + LogPrint("knbudget","CBudgetManager::FillBlockPayee - Budget payment to %s for %lld, nHighestCount = %d\n", EncodeDestination(address1), nAmount, nHighestCount); } else { - LogPrint("mnbudget","CBudgetManager::FillBlockPayee - No Budget payment, nHighestCount = %d\n", nHighestCount); + LogPrint("knbudget","CBudgetManager::FillBlockPayee - No Budget payment, nHighestCount = %d\n", nHighestCount); } } else { //miners get the full amount on these blocks @@ -596,7 +596,7 @@ void CBudgetManager::FillBlockPayee(CMutableTransaction& txNew, CAmount nFees, b CTxDestination address1; ExtractDestination(payee, address1); - LogPrint("mnbudget","CBudgetManager::FillBlockPayee - Budget payment to %s for %lld\n", EncodeDestination(address1), nAmount); + LogPrint("knbudget","CBudgetManager::FillBlockPayee - Budget payment to %s for %lld\n", EncodeDestination(address1), nAmount); } } } @@ -657,7 +657,7 @@ bool CBudgetManager::IsBudgetPaymentBlock(int nBlockHeight) ++it; } - LogPrint("mnbudget","CBudgetManager::IsBudgetPaymentBlock() - nHighestCount: %lli, 5%% of Karmanodes: %lli. Number of budgets: %lli\n", + LogPrint("knbudget","CBudgetManager::IsBudgetPaymentBlock() - nHighestCount: %lli, 5%% of Karmanodes: %lli. Number of budgets: %lli\n", nHighestCount, nFivePercent, mapFinalizedBudgets.size()); // If budget doesn't have 5% of the network votes, then we should pay a karmanode instead @@ -691,7 +691,7 @@ TrxValidationStatus CBudgetManager::IsTransactionValid(const CTransaction& txNew ++it; } - LogPrint("mnbudget","CBudgetManager::IsTransactionValid() - nHighestCount: %lli, 5%% of Karmanodes: %lli mapFinalizedBudgets.size(): %ld\n", + LogPrint("knbudget","CBudgetManager::IsTransactionValid() - nHighestCount: %lli, 5%% of Karmanodes: %lli mapFinalizedBudgets.size(): %ld\n", nHighestCount, nFivePercent, mapFinalizedBudgets.size()); /* If budget doesn't have 5% of the network votes, then we should pay a karmanode instead @@ -708,23 +708,23 @@ TrxValidationStatus CBudgetManager::IsTransactionValid(const CTransaction& txNew CFinalizedBudget* pfinalizedBudget = &((*it).second); strProposals = pfinalizedBudget->GetProposals(); - LogPrint("mnbudget","CBudgetManager::IsTransactionValid - checking budget (%s) with blockstart %lli, blockend %lli, nBlockHeight %lli, votes %lli, nCountThreshold %lli\n", + LogPrint("knbudget","CBudgetManager::IsTransactionValid - checking budget (%s) with blockstart %lli, blockend %lli, nBlockHeight %lli, votes %lli, nCountThreshold %lli\n", strProposals.c_str(), pfinalizedBudget->GetBlockStart(), pfinalizedBudget->GetBlockEnd(), nBlockHeight, pfinalizedBudget->GetVoteCount(), nCountThreshold); if (pfinalizedBudget->GetVoteCount() > nCountThreshold) { fThreshold = true; if (nBlockHeight >= pfinalizedBudget->GetBlockStart() && nBlockHeight <= pfinalizedBudget->GetBlockEnd()) { - LogPrint("mnbudget","CBudgetManager::IsTransactionValid - GetBlockStart() passed\n"); + LogPrint("knbudget","CBudgetManager::IsTransactionValid - GetBlockStart() passed\n"); transactionStatus = pfinalizedBudget->IsTransactionValid(txNew, nBlockHeight); if (transactionStatus == TrxValidationStatus::Valid) { - LogPrint("mnbudget","CBudgetManager::IsTransactionValid - pfinalizedBudget->IsTransactionValid() passed\n"); + LogPrint("knbudget","CBudgetManager::IsTransactionValid - pfinalizedBudget->IsTransactionValid() passed\n"); return TrxValidationStatus::Valid; } else { - LogPrint("mnbudget","CBudgetManager::IsTransactionValid - pfinalizedBudget->IsTransactionValid() error\n"); + LogPrint("knbudget","CBudgetManager::IsTransactionValid - pfinalizedBudget->IsTransactionValid() error\n"); } } else { - LogPrint("mnbudget","CBudgetManager::IsTransactionValid - GetBlockStart() failed, budget is outside current payment cycle and will be ignored.\n"); + LogPrint("knbudget","CBudgetManager::IsTransactionValid - GetBlockStart() failed, budget is outside current payment cycle and will be ignored.\n"); } } ++it; @@ -805,14 +805,14 @@ std::vector CBudgetManager::GetBudget() while (it2 != vBudgetPorposalsSort.end()) { CBudgetProposal* pbudgetProposal = (*it2).first; - LogPrint("mnbudget","CBudgetManager::GetBudget() - Processing Budget %s\n", pbudgetProposal->strProposalName.c_str()); + LogPrint("knbudget","CBudgetManager::GetBudget() - Processing Budget %s\n", pbudgetProposal->strProposalName.c_str()); //prop start/end should be inside this period if (pbudgetProposal->fValid && pbudgetProposal->nBlockStart <= nBlockStart && pbudgetProposal->nBlockEnd >= nBlockEnd && pbudgetProposal->GetYeas() - pbudgetProposal->GetNays() > mnodeman.CountEnabled(ActiveProtocol()) / 10 && pbudgetProposal->IsEstablished()) { - LogPrint("mnbudget","CBudgetManager::GetBudget() - Check 1 passed: valid=%d | %ld <= %ld | %ld >= %ld | Yeas=%d Nays=%d Count=%d | established=%d\n", + LogPrint("knbudget","CBudgetManager::GetBudget() - Check 1 passed: valid=%d | %ld <= %ld | %ld >= %ld | Yeas=%d Nays=%d Count=%d | established=%d\n", pbudgetProposal->fValid, pbudgetProposal->nBlockStart, nBlockStart, pbudgetProposal->nBlockEnd, nBlockEnd, pbudgetProposal->GetYeas(), pbudgetProposal->GetNays(), mnodeman.CountEnabled(ActiveProtocol()) / 10, pbudgetProposal->IsEstablished()); @@ -821,14 +821,14 @@ std::vector CBudgetManager::GetBudget() pbudgetProposal->SetAllotted(pbudgetProposal->GetAmount()); nBudgetAllocated += pbudgetProposal->GetAmount(); vBudgetProposalsRet.push_back(pbudgetProposal); - LogPrint("mnbudget","CBudgetManager::GetBudget() - Check 2 passed: Budget added\n"); + LogPrint("knbudget","CBudgetManager::GetBudget() - Check 2 passed: Budget added\n"); } else { pbudgetProposal->SetAllotted(0); - LogPrint("mnbudget","CBudgetManager::GetBudget() - Check 2 failed: no amount allotted\n"); + LogPrint("knbudget","CBudgetManager::GetBudget() - Check 2 failed: no amount allotted\n"); } } else { - LogPrint("mnbudget","CBudgetManager::GetBudget() - Check 1 failed: valid=%d | %ld <= %ld | %ld >= %ld | Yeas=%d Nays=%d Count=%d | established=%d\n", + LogPrint("knbudget","CBudgetManager::GetBudget() - Check 1 failed: valid=%d | %ld <= %ld | %ld >= %ld | Yeas=%d Nays=%d Count=%d | established=%d\n", pbudgetProposal->fValid, pbudgetProposal->nBlockStart, nBlockStart, pbudgetProposal->nBlockEnd, nBlockEnd, pbudgetProposal->GetYeas(), pbudgetProposal->GetNays(), mnodeman.CountEnabled(ActiveProtocol()) / 10, pbudgetProposal->IsEstablished()); @@ -895,7 +895,7 @@ std::string CBudgetManager::GetRequiredPaymentsString(int nBlockHeight) ret += payment.nProposalHash.ToString(); } } else { - LogPrint("mnbudget","CBudgetManager::GetRequiredPaymentsString - Couldn't find budget payment for block %d\n", nBlockHeight); + LogPrint("knbudget","CBudgetManager::GetRequiredPaymentsString - Couldn't find budget payment for block %d\n", nBlockHeight); } } @@ -964,7 +964,7 @@ void CBudgetManager::NewBlock() // incremental sync with our peers if (karmanodeSync.IsSynced()) { - LogPrint("mnbudget","CBudgetManager::NewBlock - incremental sync started\n"); + LogPrint("knbudget","CBudgetManager::NewBlock - incremental sync started\n"); if (chainActive.Height() % 1440 == rand() % 1440) { ClearSeen(); ResetSync(); @@ -983,7 +983,7 @@ void CBudgetManager::NewBlock() //remove invalid votes once in a while (we have to check the signatures and validity of every vote, somewhat CPU intensive) - LogPrint("mnbudget","CBudgetManager::NewBlock - askedForSourceProposalOrBudget cleanup - size: %d\n", askedForSourceProposalOrBudget.size()); + LogPrint("knbudget","CBudgetManager::NewBlock - askedForSourceProposalOrBudget cleanup - size: %d\n", askedForSourceProposalOrBudget.size()); std::map::iterator it = askedForSourceProposalOrBudget.begin(); while (it != askedForSourceProposalOrBudget.end()) { if ((*it).second > GetTime() - (60 * 60 * 24)) { @@ -993,21 +993,21 @@ void CBudgetManager::NewBlock() } } - LogPrint("mnbudget","CBudgetManager::NewBlock - mapProposals cleanup - size: %d\n", mapProposals.size()); + LogPrint("knbudget","CBudgetManager::NewBlock - mapProposals cleanup - size: %d\n", mapProposals.size()); std::map::iterator it2 = mapProposals.begin(); while (it2 != mapProposals.end()) { (*it2).second.CleanAndRemove(false); ++it2; } - LogPrint("mnbudget","CBudgetManager::NewBlock - mapFinalizedBudgets cleanup - size: %d\n", mapFinalizedBudgets.size()); + LogPrint("knbudget","CBudgetManager::NewBlock - mapFinalizedBudgets cleanup - size: %d\n", mapFinalizedBudgets.size()); std::map::iterator it3 = mapFinalizedBudgets.begin(); while (it3 != mapFinalizedBudgets.end()) { (*it3).second.CleanAndRemove(false); ++it3; } - LogPrint("mnbudget","CBudgetManager::NewBlock - vecImmatureBudgetProposals cleanup - size: %d\n", vecImmatureBudgetProposals.size()); + LogPrint("knbudget","CBudgetManager::NewBlock - vecImmatureBudgetProposals cleanup - size: %d\n", vecImmatureBudgetProposals.size()); std::vector::iterator it4 = vecImmatureBudgetProposals.begin(); while (it4 != vecImmatureBudgetProposals.end()) { std::string strError = ""; @@ -1018,7 +1018,7 @@ void CBudgetManager::NewBlock() } if (!(*it4).IsValid(strError)) { - LogPrint("mnbudget","mprop (immature) - invalid budget proposal - %s\n", strError); + LogPrint("knbudget","mprop (immature) - invalid budget proposal - %s\n", strError); it4 = vecImmatureBudgetProposals.erase(it4); continue; } @@ -1028,11 +1028,11 @@ void CBudgetManager::NewBlock() (*it4).Relay(); } - LogPrint("mnbudget","mprop (immature) - new budget - %s\n", (*it4).GetHash().ToString()); + LogPrint("knbudget","mprop (immature) - new budget - %s\n", (*it4).GetHash().ToString()); it4 = vecImmatureBudgetProposals.erase(it4); } - LogPrint("mnbudget","CBudgetManager::NewBlock - vecImmatureFinalizedBudgets cleanup - size: %d\n", vecImmatureFinalizedBudgets.size()); + LogPrint("knbudget","CBudgetManager::NewBlock - vecImmatureFinalizedBudgets cleanup - size: %d\n", vecImmatureFinalizedBudgets.size()); std::vector::iterator it5 = vecImmatureFinalizedBudgets.begin(); while (it5 != vecImmatureFinalizedBudgets.end()) { std::string strError = ""; @@ -1043,12 +1043,12 @@ void CBudgetManager::NewBlock() } if (!(*it5).IsValid(strError)) { - LogPrint("mnbudget","fbs (immature) - invalid finalized budget - %s\n", strError); + LogPrint("knbudget","fbs (immature) - invalid finalized budget - %s\n", strError); it5 = vecImmatureFinalizedBudgets.erase(it5); continue; } - LogPrint("mnbudget","fbs (immature) - new finalized budget - %s\n", (*it5).GetHash().ToString()); + LogPrint("knbudget","fbs (immature) - new finalized budget - %s\n", (*it5).GetHash().ToString()); CFinalizedBudget finalizedBudget((*it5)); if (AddFinalizedBudget(finalizedBudget)) { @@ -1057,7 +1057,7 @@ void CBudgetManager::NewBlock() it5 = vecImmatureFinalizedBudgets.erase(it5); } - LogPrint("mnbudget","CBudgetManager::NewBlock - PASSED\n"); + LogPrint("knbudget","CBudgetManager::NewBlock - PASSED\n"); } void CBudgetManager::ProcessMessage(CNode* pfrom, std::string& strCommand, CDataStream& vRecv) @@ -1075,7 +1075,7 @@ void CBudgetManager::ProcessMessage(CNode* pfrom, std::string& strCommand, CData if (Params().NetworkID() == CBaseChainParams::MAIN) { if (nProp == 0) { if (pfrom->HasFulfilledRequest(NetMsgType::MNVS)) { - LogPrint("mnbudget","mnvs - peer already asked me for the list\n"); + LogPrint("knbudget","mnvs - peer already asked me for the list\n"); Misbehaving(pfrom->GetId(), 20); return; } @@ -1084,7 +1084,7 @@ void CBudgetManager::ProcessMessage(CNode* pfrom, std::string& strCommand, CData } Sync(pfrom, nProp); - LogPrint("mnbudget", "mnvs - Sent Karmanode votes to peer %i\n", pfrom->GetId()); + LogPrint("knbudget", "mnvs - Sent Karmanode votes to peer %i\n", pfrom->GetId()); } if (strCommand == NetMsgType::MPROP) { //Karmanode Proposal @@ -1099,7 +1099,7 @@ void CBudgetManager::ProcessMessage(CNode* pfrom, std::string& strCommand, CData std::string strError = ""; int nConf = 0; if (!IsBudgetCollateralValid(budgetProposalBroadcast.nFeeTXHash, budgetProposalBroadcast.GetHash(), strError, budgetProposalBroadcast.nTime, nConf)) { - LogPrint("mnbudget","Proposal FeeTX is not valid - %s - %s\n", budgetProposalBroadcast.nFeeTXHash.ToString(), strError); + LogPrint("knbudget","Proposal FeeTX is not valid - %s - %s\n", budgetProposalBroadcast.nFeeTXHash.ToString(), strError); if (nConf >= 1) vecImmatureBudgetProposals.push_back(budgetProposalBroadcast); return; } @@ -1107,7 +1107,7 @@ void CBudgetManager::ProcessMessage(CNode* pfrom, std::string& strCommand, CData mapSeenKarmanodeBudgetProposals.insert(make_pair(budgetProposalBroadcast.GetHash(), budgetProposalBroadcast)); if (!budgetProposalBroadcast.IsValid(strError)) { - LogPrint("mnbudget","mprop - invalid budget proposal - %s\n", strError); + LogPrint("knbudget","mprop - invalid budget proposal - %s\n", strError); return; } @@ -1117,7 +1117,7 @@ void CBudgetManager::ProcessMessage(CNode* pfrom, std::string& strCommand, CData } karmanodeSync.AddedBudgetItem(budgetProposalBroadcast.GetHash()); - LogPrint("mnbudget","mprop - new budget - %s\n", budgetProposalBroadcast.GetHash().ToString()); + LogPrint("knbudget","mprop - new budget - %s\n", budgetProposalBroadcast.GetHash().ToString()); //We might have active votes for this proposal that are valid now CheckOrphanVotes(); @@ -1135,7 +1135,7 @@ void CBudgetManager::ProcessMessage(CNode* pfrom, std::string& strCommand, CData CKarmanode* pmn = mnodeman.Find(vote.vin); if (pmn == NULL) { - LogPrint("mnbudget","mvote - unknown karmanode - vin: %s\n", vote.vin.prevout.hash.ToString()); + LogPrint("knbudget","mvote - unknown karmanode - vin: %s\n", vote.vin.prevout.hash.ToString()); mnodeman.AskForMN(pfrom, vote.vin); return; } @@ -1158,7 +1158,7 @@ void CBudgetManager::ProcessMessage(CNode* pfrom, std::string& strCommand, CData karmanodeSync.AddedBudgetItem(vote.GetHash()); } - LogPrint("mnbudget","mvote - new budget vote for budget %s - %s\n", vote.nProposalHash.ToString(), vote.GetHash().ToString()); + LogPrint("knbudget","mvote - new budget vote for budget %s - %s\n", vote.nProposalHash.ToString(), vote.GetHash().ToString()); } if (strCommand == NetMsgType::FBS) { //Finalized Budget Suggestion @@ -1173,7 +1173,7 @@ void CBudgetManager::ProcessMessage(CNode* pfrom, std::string& strCommand, CData std::string strError = ""; int nConf = 0; if (!IsBudgetCollateralValid(finalizedBudgetBroadcast.nFeeTXHash, finalizedBudgetBroadcast.GetHash(), strError, finalizedBudgetBroadcast.nTime, nConf, true)) { - LogPrint("mnbudget","fbs - Finalized Budget FeeTX is not valid - %s - %s\n", finalizedBudgetBroadcast.nFeeTXHash.ToString(), strError); + LogPrint("knbudget","fbs - Finalized Budget FeeTX is not valid - %s - %s\n", finalizedBudgetBroadcast.nFeeTXHash.ToString(), strError); if (nConf >= 1) vecImmatureFinalizedBudgets.push_back(finalizedBudgetBroadcast); return; @@ -1182,11 +1182,11 @@ void CBudgetManager::ProcessMessage(CNode* pfrom, std::string& strCommand, CData mapSeenFinalizedBudgets.insert(make_pair(finalizedBudgetBroadcast.GetHash(), finalizedBudgetBroadcast)); if (!finalizedBudgetBroadcast.IsValid(strError)) { - LogPrint("mnbudget","fbs - invalid finalized budget - %s\n", strError); + LogPrint("knbudget","fbs - invalid finalized budget - %s\n", strError); return; } - LogPrint("mnbudget","fbs - new finalized budget - %s\n", finalizedBudgetBroadcast.GetHash().ToString()); + LogPrint("knbudget","fbs - new finalized budget - %s\n", finalizedBudgetBroadcast.GetHash().ToString()); CFinalizedBudget finalizedBudget(finalizedBudgetBroadcast); if (AddFinalizedBudget(finalizedBudget)) { @@ -1210,7 +1210,7 @@ void CBudgetManager::ProcessMessage(CNode* pfrom, std::string& strCommand, CData CKarmanode* pmn = mnodeman.Find(vote.vin); if (pmn == NULL) { - LogPrint("mnbudget", "fbvote - unknown karmanode - vin: %s\n", vote.vin.prevout.hash.ToString()); + LogPrint("knbudget", "fbvote - unknown karmanode - vin: %s\n", vote.vin.prevout.hash.ToString()); mnodeman.AskForMN(pfrom, vote.vin); return; } @@ -1231,9 +1231,9 @@ void CBudgetManager::ProcessMessage(CNode* pfrom, std::string& strCommand, CData vote.Relay(); karmanodeSync.AddedBudgetItem(vote.GetHash()); - LogPrint("mnbudget","fbvote - new finalized budget vote - %s from karmanode %s\n", vote.GetHash().ToString(), HexStr(pmn->pubKeyKarmanode)); + LogPrint("knbudget","fbvote - new finalized budget vote - %s from karmanode %s\n", vote.GetHash().ToString(), HexStr(pmn->pubKeyKarmanode)); } else { - LogPrint("mnbudget","fbvote - rejected finalized budget vote - %s from karmanode %s - %s\n", vote.GetHash().ToString(), HexStr(pmn->pubKeyKarmanode), strError); + LogPrint("knbudget","fbvote - rejected finalized budget vote - %s from karmanode %s - %s\n", vote.GetHash().ToString(), HexStr(pmn->pubKeyKarmanode), strError); } } } @@ -1359,7 +1359,7 @@ void CBudgetManager::Sync(CNode* pfrom, uint256 nProp, bool fPartial) pfrom->PushMessage(NetMsgType::SSC, KARMANODE_SYNC_BUDGET_PROP, nInvCount); - LogPrint("mnbudget", "CBudgetManager::Sync - sent %d items\n", nInvCount); + LogPrint("knbudget", "CBudgetManager::Sync - sent %d items\n", nInvCount); nInvCount = 0; @@ -1386,7 +1386,7 @@ void CBudgetManager::Sync(CNode* pfrom, uint256 nProp, bool fPartial) } pfrom->PushMessage(NetMsgType::SSC, KARMANODE_SYNC_BUDGET_FIN, nInvCount); - LogPrint("mnbudget", "CBudgetManager::Sync - sent %d items\n", nInvCount); + LogPrint("knbudget", "CBudgetManager::Sync - sent %d items\n", nInvCount); } bool CBudgetManager::UpdateProposal(CBudgetVote& vote, CNode* pfrom, std::string& strError) @@ -1399,7 +1399,7 @@ bool CBudgetManager::UpdateProposal(CBudgetVote& vote, CNode* pfrom, std::string // otherwise we'll think a full sync succeeded when they return a result if (!karmanodeSync.IsSynced()) return false; - LogPrint("mnbudget","CBudgetManager::UpdateProposal - Unknown proposal %d, asking for source proposal\n", vote.nProposalHash.ToString()); + LogPrint("knbudget","CBudgetManager::UpdateProposal - Unknown proposal %d, asking for source proposal\n", vote.nProposalHash.ToString()); mapOrphanKarmanodeBudgetVotes[vote.nProposalHash] = vote; if (!askedForSourceProposalOrBudget.count(vote.nProposalHash)) { @@ -1426,7 +1426,7 @@ bool CBudgetManager::UpdateFinalizedBudget(CFinalizedBudgetVote& vote, CNode* pf // otherwise we'll think a full sync succeeded when they return a result if (!karmanodeSync.IsSynced()) return false; - LogPrint("mnbudget","CBudgetManager::UpdateFinalizedBudget - Unknown Finalized Proposal %s, asking for source budget\n", vote.nBudgetHash.ToString()); + LogPrint("knbudget","CBudgetManager::UpdateFinalizedBudget - Unknown Finalized Proposal %s, asking for source budget\n", vote.nBudgetHash.ToString()); mapOrphanFinalizedBudgetVotes[vote.nBudgetHash] = vote; if (!askedForSourceProposalOrBudget.count(vote.nBudgetHash)) { @@ -1438,7 +1438,7 @@ bool CBudgetManager::UpdateFinalizedBudget(CFinalizedBudgetVote& vote, CNode* pf strError = "Finalized Budget " + vote.nBudgetHash.ToString() + " not found!"; return false; } - LogPrint("mnbudget","CBudgetManager::UpdateFinalizedBudget - Finalized Proposal %s added\n", vote.nBudgetHash.ToString()); + LogPrint("knbudget","CBudgetManager::UpdateFinalizedBudget - Finalized Proposal %s added\n", vote.nBudgetHash.ToString()); return mapFinalizedBudgets[vote.nBudgetHash].AddOrUpdateVote(vote, strError); } @@ -1565,12 +1565,12 @@ bool CBudgetProposal::AddOrUpdateVote(CBudgetVote& vote, std::string& strError) if (mapVotes.count(hash)) { if (mapVotes[hash].nTime > vote.nTime) { strError = strprintf("new vote older than existing vote - %s\n", vote.GetHash().ToString()); - LogPrint("mnbudget", "CBudgetProposal::AddOrUpdateVote - %s\n", strError); + LogPrint("knbudget", "CBudgetProposal::AddOrUpdateVote - %s\n", strError); return false; } if (vote.nTime - mapVotes[hash].nTime < BUDGET_VOTE_UPDATE_MIN) { strError = strprintf("time between votes is too soon - %s - %lli sec < %lli sec\n", vote.GetHash().ToString(), vote.nTime - mapVotes[hash].nTime,BUDGET_VOTE_UPDATE_MIN); - LogPrint("mnbudget", "CBudgetProposal::AddOrUpdateVote - %s\n", strError); + LogPrint("knbudget", "CBudgetProposal::AddOrUpdateVote - %s\n", strError); return false; } strAction = "Existing vote updated:"; @@ -1578,12 +1578,12 @@ bool CBudgetProposal::AddOrUpdateVote(CBudgetVote& vote, std::string& strError) if (vote.nTime > GetTime() + (60 * 60)) { strError = strprintf("new vote is too far ahead of current time - %s - nTime %lli - Max Time %lli\n", vote.GetHash().ToString(), vote.nTime, GetTime() + (60 * 60)); - LogPrint("mnbudget", "CBudgetProposal::AddOrUpdateVote - %s\n", strError); + LogPrint("knbudget", "CBudgetProposal::AddOrUpdateVote - %s\n", strError); return false; } mapVotes[hash] = vote; - LogPrint("mnbudget", "CBudgetProposal::AddOrUpdateVote - %s %s\n", strAction.c_str(), vote.GetHash().ToString().c_str()); + LogPrint("knbudget", "CBudgetProposal::AddOrUpdateVote - %s %s\n", strAction.c_str(), vote.GetHash().ToString().c_str()); return true; } @@ -1763,12 +1763,12 @@ bool CBudgetVote::Sign(CKey& keyKarmanode, CPubKey& pubKeyKarmanode) std::string strMessage = vin.prevout.ToStringShort() + nProposalHash.ToString() + std::to_string(nVote) + std::to_string(nTime); if (!obfuScationSigner.SignMessage(strMessage, errorMessage, vchSig, keyKarmanode)) { - LogPrint("mnbudget","CBudgetVote::Sign - Error upon calling SignMessage"); + LogPrint("knbudget","CBudgetVote::Sign - Error upon calling SignMessage"); return false; } if (!obfuScationSigner.VerifyMessage(pubKeyKarmanode, vchSig, strMessage, errorMessage)) { - LogPrint("mnbudget","CBudgetVote::Sign - Error upon calling VerifyMessage"); + LogPrint("knbudget","CBudgetVote::Sign - Error upon calling VerifyMessage"); return false; } @@ -1784,7 +1784,7 @@ bool CBudgetVote::SignatureValid(bool fSignatureCheck) if (pmn == NULL) { if (fDebug){ - LogPrint("mnbudget","CBudgetVote::SignatureValid() - Unknown Karmanode - %s\n", vin.prevout.hash.ToString()); + LogPrint("knbudget","CBudgetVote::SignatureValid() - Unknown Karmanode - %s\n", vin.prevout.hash.ToString()); } return false; } @@ -1792,7 +1792,7 @@ bool CBudgetVote::SignatureValid(bool fSignatureCheck) if (!fSignatureCheck) return true; if (!obfuScationSigner.VerifyMessage(pmn->pubKeyKarmanode, vchSig, strMessage, errorMessage)) { - LogPrint("mnbudget","CBudgetVote::SignatureValid() - Verify message failed\n"); + LogPrint("knbudget","CBudgetVote::SignatureValid() - Verify message failed\n"); return false; } @@ -1833,12 +1833,12 @@ bool CFinalizedBudget::AddOrUpdateVote(CFinalizedBudgetVote& vote, std::string& if (mapVotes.count(hash)) { if (mapVotes[hash].nTime > vote.nTime) { strError = strprintf("new vote older than existing vote - %s\n", vote.GetHash().ToString()); - LogPrint("mnbudget", "CFinalizedBudget::AddOrUpdateVote - %s\n", strError); + LogPrint("knbudget", "CFinalizedBudget::AddOrUpdateVote - %s\n", strError); return false; } if (vote.nTime - mapVotes[hash].nTime < BUDGET_VOTE_UPDATE_MIN) { strError = strprintf("time between votes is too soon - %s - %lli sec < %lli sec\n", vote.GetHash().ToString(), vote.nTime - mapVotes[hash].nTime,BUDGET_VOTE_UPDATE_MIN); - LogPrint("mnbudget", "CFinalizedBudget::AddOrUpdateVote - %s\n", strError); + LogPrint("knbudget", "CFinalizedBudget::AddOrUpdateVote - %s\n", strError); return false; } strAction = "Existing vote updated:"; @@ -1846,12 +1846,12 @@ bool CFinalizedBudget::AddOrUpdateVote(CFinalizedBudgetVote& vote, std::string& if (vote.nTime > GetTime() + (60 * 60)) { strError = strprintf("new vote is too far ahead of current time - %s - nTime %lli - Max Time %lli\n", vote.GetHash().ToString(), vote.nTime, GetTime() + (60 * 60)); - LogPrint("mnbudget", "CFinalizedBudget::AddOrUpdateVote - %s\n", strError); + LogPrint("knbudget", "CFinalizedBudget::AddOrUpdateVote - %s\n", strError); return false; } mapVotes[hash] = vote; - LogPrint("mnbudget", "CFinalizedBudget::AddOrUpdateVote - %s %s\n", strAction.c_str(), vote.GetHash().ToString().c_str()); + LogPrint("knbudget", "CFinalizedBudget::AddOrUpdateVote - %s %s\n", strAction.c_str(), vote.GetHash().ToString().c_str()); return true; } @@ -1879,17 +1879,17 @@ void CFinalizedBudget::CheckAndVote() CBlockIndex* pindexPrev = chainActive.Tip(); if (!pindexPrev) return; - LogPrint("mnbudget","CFinalizedBudget::AutoCheck - %lli - %d\n", pindexPrev->nHeight, fAutoChecked); + LogPrint("knbudget","CFinalizedBudget::AutoCheck - %lli - %d\n", pindexPrev->nHeight, fAutoChecked); if (!fMasterNode || fAutoChecked) { - LogPrint("mnbudget","CFinalizedBudget::AutoCheck fMasterNode=%d fAutoChecked=%d\n", fMasterNode, fAutoChecked); + LogPrint("knbudget","CFinalizedBudget::AutoCheck fMasterNode=%d fAutoChecked=%d\n", fMasterNode, fAutoChecked); return; } // Do this 1 in 4 blocks -- spread out the voting activity on mainnet // -- this function is only called every fourteenth block, so this is really 1 in 56 blocks if (rand() % 4 != 0) { - LogPrint("mnbudget","CFinalizedBudget::AutoCheck - waiting\n"); + LogPrint("knbudget","CFinalizedBudget::AutoCheck - waiting\n"); return; } @@ -1912,52 +1912,52 @@ void CFinalizedBudget::CheckAndVote() std::sort(vecBudgetPaymentsSortedByHash.begin(), vecBudgetPaymentsSortedByHash.end(), sortPaymentsByHash()); for (unsigned int i = 0; i < vecBudgetPaymentsSortedByHash.size(); i++) { - LogPrint("mnbudget","CFinalizedBudget::AutoCheck Budget-Payments - nProp %d %s\n", i, vecBudgetPaymentsSortedByHash[i].nProposalHash.ToString()); - LogPrint("mnbudget","CFinalizedBudget::AutoCheck Budget-Payments - Payee %d %s\n", i, vecBudgetPaymentsSortedByHash[i].payee.ToString()); - LogPrint("mnbudget","CFinalizedBudget::AutoCheck Budget-Payments - nAmount %d %lli\n", i, vecBudgetPaymentsSortedByHash[i].nAmount); + LogPrint("knbudget","CFinalizedBudget::AutoCheck Budget-Payments - nProp %d %s\n", i, vecBudgetPaymentsSortedByHash[i].nProposalHash.ToString()); + LogPrint("knbudget","CFinalizedBudget::AutoCheck Budget-Payments - Payee %d %s\n", i, vecBudgetPaymentsSortedByHash[i].payee.ToString()); + LogPrint("knbudget","CFinalizedBudget::AutoCheck Budget-Payments - nAmount %d %lli\n", i, vecBudgetPaymentsSortedByHash[i].nAmount); } for (unsigned int i = 0; i < vBudgetProposalsSortedByHash.size(); i++) { - LogPrint("mnbudget","CFinalizedBudget::AutoCheck Budget-Proposals - nProp %d %s\n", i, vBudgetProposalsSortedByHash[i]->GetHash().ToString()); - LogPrint("mnbudget","CFinalizedBudget::AutoCheck Budget-Proposals - Payee %d %s\n", i, vBudgetProposalsSortedByHash[i]->GetPayee().ToString()); - LogPrint("mnbudget","CFinalizedBudget::AutoCheck Budget-Proposals - nAmount %d %lli\n", i, vBudgetProposalsSortedByHash[i]->GetAmount()); + LogPrint("knbudget","CFinalizedBudget::AutoCheck Budget-Proposals - nProp %d %s\n", i, vBudgetProposalsSortedByHash[i]->GetHash().ToString()); + LogPrint("knbudget","CFinalizedBudget::AutoCheck Budget-Proposals - Payee %d %s\n", i, vBudgetProposalsSortedByHash[i]->GetPayee().ToString()); + LogPrint("knbudget","CFinalizedBudget::AutoCheck Budget-Proposals - nAmount %d %lli\n", i, vBudgetProposalsSortedByHash[i]->GetAmount()); } if (vBudgetProposalsSortedByHash.size() == 0) { - LogPrint("mnbudget","CFinalizedBudget::AutoCheck - No Budget-Proposals found, aborting\n"); + LogPrint("knbudget","CFinalizedBudget::AutoCheck - No Budget-Proposals found, aborting\n"); return; } if (vBudgetProposalsSortedByHash.size() != vecBudgetPaymentsSortedByHash.size()) { - LogPrint("mnbudget","CFinalizedBudget::AutoCheck - Budget-Proposal length (%ld) doesn't match Budget-Payment length (%ld).\n", + LogPrint("knbudget","CFinalizedBudget::AutoCheck - Budget-Proposal length (%ld) doesn't match Budget-Payment length (%ld).\n", vBudgetProposalsSortedByHash.size(), vecBudgetPaymentsSortedByHash.size()); return; } for (unsigned int i = 0; i < vecBudgetPaymentsSortedByHash.size(); i++) { if (i > vBudgetProposalsSortedByHash.size() - 1) { - LogPrint("mnbudget","CFinalizedBudget::AutoCheck - Proposal size mismatch, i=%d > (vBudgetProposals.size() - 1)=%d\n", i, vBudgetProposalsSortedByHash.size() - 1); + LogPrint("knbudget","CFinalizedBudget::AutoCheck - Proposal size mismatch, i=%d > (vBudgetProposals.size() - 1)=%d\n", i, vBudgetProposalsSortedByHash.size() - 1); return; } if (vecBudgetPaymentsSortedByHash[i].nProposalHash != vBudgetProposalsSortedByHash[i]->GetHash()) { - LogPrint("mnbudget","CFinalizedBudget::AutoCheck - item #%d doesn't match %s %s\n", i, vecBudgetPaymentsSortedByHash[i].nProposalHash.ToString(), vBudgetProposalsSortedByHash[i]->GetHash().ToString()); + LogPrint("knbudget","CFinalizedBudget::AutoCheck - item #%d doesn't match %s %s\n", i, vecBudgetPaymentsSortedByHash[i].nProposalHash.ToString(), vBudgetProposalsSortedByHash[i]->GetHash().ToString()); return; } // if(vecBudgetPayments[i].payee != vBudgetProposals[i]->GetPayee()){ -- triggered with false positive if (vecBudgetPaymentsSortedByHash[i].payee.ToString() != vBudgetProposalsSortedByHash[i]->GetPayee().ToString()) { - LogPrint("mnbudget","CFinalizedBudget::AutoCheck - item #%d payee doesn't match %s %s\n", i, vecBudgetPaymentsSortedByHash[i].payee.ToString(), vBudgetProposalsSortedByHash[i]->GetPayee().ToString()); + LogPrint("knbudget","CFinalizedBudget::AutoCheck - item #%d payee doesn't match %s %s\n", i, vecBudgetPaymentsSortedByHash[i].payee.ToString(), vBudgetProposalsSortedByHash[i]->GetPayee().ToString()); return; } if (vecBudgetPaymentsSortedByHash[i].nAmount != vBudgetProposalsSortedByHash[i]->GetAmount()) { - LogPrint("mnbudget","CFinalizedBudget::AutoCheck - item #%d payee doesn't match %lli %lli\n", i, vecBudgetPaymentsSortedByHash[i].nAmount, vBudgetProposalsSortedByHash[i]->GetAmount()); + LogPrint("knbudget","CFinalizedBudget::AutoCheck - item #%d payee doesn't match %lli %lli\n", i, vecBudgetPaymentsSortedByHash[i].nAmount, vBudgetProposalsSortedByHash[i]->GetAmount()); return; } } - LogPrint("mnbudget","CFinalizedBudget::AutoCheck - Finalized Budget Matches! Submitting Vote.\n"); + LogPrint("knbudget","CFinalizedBudget::AutoCheck - Finalized Budget Matches! Submitting Vote.\n"); SubmitVote(); } } @@ -2012,7 +2012,7 @@ std::string CFinalizedBudget::GetStatus() for (int nBlockHeight = GetBlockStart(); nBlockHeight <= GetBlockEnd(); nBlockHeight++) { CTxBudgetPayment budgetPayment; if (!GetBudgetPaymentByBlock(nBlockHeight, budgetPayment)) { - LogPrint("mnbudget","CFinalizedBudget::GetStatus - Couldn't find budget payment for block %lld\n", nBlockHeight); + LogPrint("knbudget","CFinalizedBudget::GetStatus - Couldn't find budget payment for block %lld\n", nBlockHeight); continue; } @@ -2120,7 +2120,7 @@ bool CFinalizedBudget::IsPaidAlready(uint256 nProposalHash, int nBlockHeight) nPaidBlockHeight = (*it).second; if((nPaidBlockHeight < GetBlockStart()) || (nPaidBlockHeight > GetBlockEnd())) { nOldProposalHash = (*it).first; - LogPrint("mnbudget", "CFinalizedBudget::IsPaidAlready - Budget Proposal %s, Block %d from old cycle deleted\n", + LogPrint("knbudget", "CFinalizedBudget::IsPaidAlready - Budget Proposal %s, Block %d from old cycle deleted\n", nOldProposalHash.ToString().c_str(), nPaidBlockHeight); mapPayment_History.erase(it++); } @@ -2133,7 +2133,7 @@ bool CFinalizedBudget::IsPaidAlready(uint256 nProposalHash, int nBlockHeight) if(mapPayment_History.count(nProposalHash) == 0) { // New proposal payment, insert into map for checks with later blocks from this cycle mapPayment_History.insert(std::pair(nProposalHash, nBlockHeight)); - LogPrint("mnbudget", "CFinalizedBudget::IsPaidAlready - Budget Proposal %s, Block %d added to payment history\n", + LogPrint("knbudget", "CFinalizedBudget::IsPaidAlready - Budget Proposal %s, Block %d added to payment history\n", nProposalHash.ToString().c_str(), nBlockHeight); return false; } @@ -2146,18 +2146,18 @@ TrxValidationStatus CFinalizedBudget::IsTransactionValid(const CTransaction& txN TrxValidationStatus transactionStatus = TrxValidationStatus::Invalid; int nCurrentBudgetPayment = nBlockHeight - GetBlockStart(); if (nCurrentBudgetPayment < 0) { - LogPrint("mnbudget","CFinalizedBudget::IsTransactionValid - Invalid block - height: %d start: %d\n", nBlockHeight, GetBlockStart()); + LogPrint("knbudget","CFinalizedBudget::IsTransactionValid - Invalid block - height: %d start: %d\n", nBlockHeight, GetBlockStart()); return TrxValidationStatus::Invalid; } if (nCurrentBudgetPayment > (int)vecBudgetPayments.size() - 1) { - LogPrint("mnbudget","CFinalizedBudget::IsTransactionValid - Invalid block - current budget payment: %d of %d\n", nCurrentBudgetPayment + 1, (int)vecBudgetPayments.size()); + LogPrint("knbudget","CFinalizedBudget::IsTransactionValid - Invalid block - current budget payment: %d of %d\n", nCurrentBudgetPayment + 1, (int)vecBudgetPayments.size()); return TrxValidationStatus::Invalid; } bool paid = false; BOOST_FOREACH (CTxOut out, txNew.vout) { - LogPrint("mnbudget","CFinalizedBudget::IsTransactionValid - nCurrentBudgetPayment=%d, payee=%s == out.scriptPubKey=%s, amount=%ld == out.nValue=%ld\n", + LogPrint("knbudget","CFinalizedBudget::IsTransactionValid - nCurrentBudgetPayment=%d, payee=%s == out.scriptPubKey=%s, amount=%ld == out.nValue=%ld\n", nCurrentBudgetPayment, vecBudgetPayments[nCurrentBudgetPayment].payee.ToString().c_str(), out.scriptPubKey.ToString().c_str(), vecBudgetPayments[nCurrentBudgetPayment].nAmount, out.nValue); @@ -2165,7 +2165,7 @@ TrxValidationStatus CFinalizedBudget::IsTransactionValid(const CTransaction& txN // Check if this proposal was paid already. If so, pay a karmanode instead paid = IsPaidAlready(vecBudgetPayments[nCurrentBudgetPayment].nProposalHash, nBlockHeight); if(paid) { - LogPrint("mnbudget","CFinalizedBudget::IsTransactionValid - Double Budget Payment of %d for proposal %d detected. Paying a karmanode instead.\n", + LogPrint("knbudget","CFinalizedBudget::IsTransactionValid - Double Budget Payment of %d for proposal %d detected. Paying a karmanode instead.\n", vecBudgetPayments[nCurrentBudgetPayment].nAmount, vecBudgetPayments[nCurrentBudgetPayment].nProposalHash.Get32()); // No matter what we've found before, stop all checks here. In future releases there might be more than one budget payment // per block, so even if the first one was not paid yet this one disables all budget payments for this block. @@ -2174,7 +2174,7 @@ TrxValidationStatus CFinalizedBudget::IsTransactionValid(const CTransaction& txN } else { transactionStatus = TrxValidationStatus::Valid; - LogPrint("mnbudget","CFinalizedBudget::IsTransactionValid - Found valid Budget Payment of %d for proposal %d\n", + LogPrint("knbudget","CFinalizedBudget::IsTransactionValid - Found valid Budget Payment of %d for proposal %d\n", vecBudgetPayments[nCurrentBudgetPayment].nAmount, vecBudgetPayments[nCurrentBudgetPayment].nProposalHash.Get32()); } } @@ -2184,7 +2184,7 @@ TrxValidationStatus CFinalizedBudget::IsTransactionValid(const CTransaction& txN CTxDestination address1; ExtractDestination(vecBudgetPayments[nCurrentBudgetPayment].payee, address1); - LogPrint("mnbudget","CFinalizedBudget::IsTransactionValid - Missing required payment - %s: %d c: %d\n", + LogPrint("knbudget","CFinalizedBudget::IsTransactionValid - Missing required payment - %s: %d c: %d\n", EncodeDestination(address1), vecBudgetPayments[nCurrentBudgetPayment].nAmount, nCurrentBudgetPayment); } @@ -2198,24 +2198,24 @@ void CFinalizedBudget::SubmitVote() std::string errorMessage; if (!obfuScationSigner.SetKey(strMasterNodePrivKey, errorMessage, keyKarmanode, pubKeyKarmanode)) { - LogPrint("mnbudget","CFinalizedBudget::SubmitVote - Error upon calling SetKey\n"); + LogPrint("knbudget","CFinalizedBudget::SubmitVote - Error upon calling SetKey\n"); return; } CFinalizedBudgetVote vote(activeKarmanode.vin, GetHash()); if (!vote.Sign(keyKarmanode, pubKeyKarmanode)) { - LogPrint("mnbudget","CFinalizedBudget::SubmitVote - Failure to sign."); + LogPrint("knbudget","CFinalizedBudget::SubmitVote - Failure to sign."); return; } std::string strError = ""; if (budget.UpdateFinalizedBudget(vote, NULL, strError)) { - LogPrint("mnbudget","CFinalizedBudget::SubmitVote - new finalized budget vote - %s\n", vote.GetHash().ToString()); + LogPrint("knbudget","CFinalizedBudget::SubmitVote - new finalized budget vote - %s\n", vote.GetHash().ToString()); budget.mapSeenFinalizedBudgetVotes.insert(make_pair(vote.GetHash(), vote)); vote.Relay(); } else { - LogPrint("mnbudget","CFinalizedBudget::SubmitVote : Error submitting vote - %s\n", strError); + LogPrint("knbudget","CFinalizedBudget::SubmitVote : Error submitting vote - %s\n", strError); } } @@ -2291,12 +2291,12 @@ bool CFinalizedBudgetVote::Sign(CKey& keyKarmanode, CPubKey& pubKeyKarmanode) std::string strMessage = vin.prevout.ToStringShort() + nBudgetHash.ToString() + std::to_string(nTime); if (!obfuScationSigner.SignMessage(strMessage, errorMessage, vchSig, keyKarmanode)) { - LogPrint("mnbudget","CFinalizedBudgetVote::Sign - Error upon calling SignMessage"); + LogPrint("knbudget","CFinalizedBudgetVote::Sign - Error upon calling SignMessage"); return false; } if (!obfuScationSigner.VerifyMessage(pubKeyKarmanode, vchSig, strMessage, errorMessage)) { - LogPrint("mnbudget","CFinalizedBudgetVote::Sign - Error upon calling VerifyMessage"); + LogPrint("knbudget","CFinalizedBudgetVote::Sign - Error upon calling VerifyMessage"); return false; } @@ -2312,14 +2312,14 @@ bool CFinalizedBudgetVote::SignatureValid(bool fSignatureCheck) CKarmanode* pmn = mnodeman.Find(vin); if (pmn == NULL) { - LogPrint("mnbudget","CFinalizedBudgetVote::SignatureValid() - Unknown Karmanode %s\n", strMessage); + LogPrint("knbudget","CFinalizedBudgetVote::SignatureValid() - Unknown Karmanode %s\n", strMessage); return false; } if (!fSignatureCheck) return true; if (!obfuScationSigner.VerifyMessage(pmn->pubKeyKarmanode, vchSig, strMessage, errorMessage)) { - LogPrint("mnbudget","CFinalizedBudgetVote::SignatureValid() - Verify message failed %s %s\n", strMessage, errorMessage); + LogPrint("knbudget","CFinalizedBudgetVote::SignatureValid() - Verify message failed %s %s\n", strMessage, errorMessage); return false; } diff --git a/src/karmanode-sync.cpp b/src/karmanode-sync.cpp index f92e5e5..6718bb2 100755 --- a/src/karmanode-sync.cpp +++ b/src/karmanode-sync.cpp @@ -224,8 +224,8 @@ void CKarmanodeSync::ClearFulfilledRequest() BOOST_FOREACH (CNode* pnode, vNodes) { pnode->ClearFulfilledRequest(NetMsgType::GETSPORK); - pnode->ClearFulfilledRequest("mnsync"); - pnode->ClearFulfilledRequest("mnwsync"); + pnode->ClearFulfilledRequest("knsync"); + pnode->ClearFulfilledRequest("knwsync"); pnode->ClearFulfilledRequest("busync"); } } @@ -303,8 +303,8 @@ void CKarmanodeSync::Process() return; } - if (pnode->HasFulfilledRequest("mnsync")) continue; - pnode->FulfilledRequest("mnsync"); + if (pnode->HasFulfilledRequest("knsync")) continue; + pnode->FulfilledRequest("knsync"); // timeout if (lastKarmanodeList == 0 && @@ -334,8 +334,8 @@ void CKarmanodeSync::Process() return; } - if (pnode->HasFulfilledRequest("mnwsync")) continue; - pnode->FulfilledRequest("mnwsync"); + if (pnode->HasFulfilledRequest("knwsync")) continue; + pnode->FulfilledRequest("knwsync"); // timeout if (lastKarmanodeWinner == 0 && diff --git a/src/main.cpp b/src/main.cpp index db47929..8e3ae13 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -1515,10 +1515,10 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState& state, const CTransa *pfMissingInputs = false; //Temporarily disable zerocoin for maintenance - if (GetAdjustedTime() > GetSporkValue(SPORK_20_ZEROCOIN_MAINTENANCE_MODE) && tx.ContainsZerocoins()) + if (GetAdjustedTime() > GetSporkValue(SPORK_21_ZEROCOIN_MAINTENANCE_MODE) && tx.ContainsZerocoins()) return state.DoS(10, error("AcceptToMemoryPool : Zerocoin transactions are temporarily disabled for maintenance"), REJECT_INVALID, "bad-tx"); - if (!CheckTransaction(tx, chainActive.Height() >= Params().Zerocoin_StartHeight(), true, state, GetSporkValue(SPORK_19_SEGWIT_ACTIVATION) < chainActive.Tip()->nTime)) { + if (!CheckTransaction(tx, chainActive.Height() >= Params().Zerocoin_StartHeight(), true, state, GetSporkValue(SPORK_20_SEGWIT_ACTIVATION) < chainActive.Tip()->nTime)) { return state.DoS(100, error("AcceptToMemoryPool: : CheckTransaction failed"), REJECT_INVALID, "bad-tx"); } @@ -1564,7 +1564,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState& state, const CTransa } // Don't accept witness transactions before the final threshold passes - if (!GetBoolArg("-prematurewitness", false) && !tx.wit.IsNull() && !IsSporkActive(SPORK_19_SEGWIT_ACTIVATION)) { + if (!GetBoolArg("-prematurewitness", false) && !tx.wit.IsNull() && !IsSporkActive(SPORK_20_SEGWIT_ACTIVATION)) { return state.DoS(0, false, REJECT_NONSTANDARD, "no-witness-yet", true); } @@ -1820,7 +1820,7 @@ bool AcceptableInputs(CTxMemPool& pool, CValidationState& state, const CTransact if (pfMissingInputs) *pfMissingInputs = false; - if (!CheckTransaction(tx, chainActive.Height() >= Params().Zerocoin_StartHeight(), true, state, GetSporkValue(SPORK_19_SEGWIT_ACTIVATION) < chainActive.Tip()->nTime)) + if (!CheckTransaction(tx, chainActive.Height() >= Params().Zerocoin_StartHeight(), true, state, GetSporkValue(SPORK_20_SEGWIT_ACTIVATION) < chainActive.Tip()->nTime)) return error("AcceptableInputs: : CheckTransaction failed"); // Coinbase is only valid in a block, not as a loose transaction @@ -3253,7 +3253,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin vector vSpendsInBlock; uint256 hashBlock = block.GetHash(); - if (GetSporkValue(SPORK_19_SEGWIT_ACTIVATION) < block.nTime) { + if (GetSporkValue(SPORK_20_SEGWIT_ACTIVATION) < block.nTime) { flags |= SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY | SCRIPT_VERIFY_CHECKSEQUENCEVERIFY; } @@ -3263,7 +3263,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin nInputs += tx.vin.size(); //Temporarily disable zerocoin transactions for maintenance - if (block.nTime > GetSporkValue(SPORK_20_ZEROCOIN_MAINTENANCE_MODE) && !IsInitialBlockDownload() && tx.ContainsZerocoins()) { + if (block.nTime > GetSporkValue(SPORK_21_ZEROCOIN_MAINTENANCE_MODE) && !IsInitialBlockDownload() && tx.ContainsZerocoins()) { return state.DoS(100, error("ConnectBlock() : zerocoin transactions are currently in maintenance mode")); } if (tx.IsZerocoinSpend()) { @@ -4393,7 +4393,7 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo if (block.IsProofOfStake()) { int commitpos = GetWitnessCommitmentIndex(block); if (commitpos >= 0) { - if (IsSporkActive(SPORK_21_SEGWIT_ON_COINBASE)) { + if (IsSporkActive(SPORK_22_SEGWIT_ON_COINBASE)) { if (block.vtx[0].vout.size() != 2) return state.DoS(100, error("CheckBlock() : coinbase output has wrong size for proof-of-stake block")); if (!block.vtx[0].vout[1].scriptPubKey.IsUnspendable()) @@ -4591,7 +4591,7 @@ void UpdateUncommittedBlockStructures(CBlock& block, const CBlockIndex* pindexPr { int commitpos = GetWitnessCommitmentIndex(block); static const std::vector nonce(32, 0x00); - if (commitpos != -1 && GetSporkValue(SPORK_19_SEGWIT_ACTIVATION) < pindexPrev->nTime && block.vtx[0].wit.IsEmpty()) { + if (commitpos != -1 && GetSporkValue(SPORK_20_SEGWIT_ACTIVATION) < pindexPrev->nTime && block.vtx[0].wit.IsEmpty()) { block.vtx[0].wit.vtxinwit.resize(1); block.vtx[0].wit.vtxinwit[0].scriptWitness.stack.resize(1); block.vtx[0].wit.vtxinwit[0].scriptWitness.stack[0] = nonce; @@ -4610,7 +4610,7 @@ std::vector GenerateCoinbaseCommitment(CBlock& block, const CBloc } } std::vector ret(32, 0x00); - if (fHaveWitness && GetSporkValue(SPORK_19_SEGWIT_ACTIVATION) < pindexPrev->nTime) { + if (fHaveWitness && GetSporkValue(SPORK_20_SEGWIT_ACTIVATION) < pindexPrev->nTime) { if (commitpos == -1) { uint256 witnessroot = BlockWitnessMerkleRoot(block, NULL); CHash256().Write(witnessroot.begin(), 32).Write(&ret[0], 32).Finalize(witnessroot.begin()); @@ -4669,7 +4669,7 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn vector vBlockSerials; for (const CTransaction& tx : block.vtx) { - if (!CheckTransaction(tx, true, chainActive.Height() + 1 >= Params().Zerocoin_StartHeight(), state, GetSporkValue(SPORK_19_SEGWIT_ACTIVATION) < block.nTime)) + if (!CheckTransaction(tx, true, chainActive.Height() + 1 >= Params().Zerocoin_StartHeight(), state, GetSporkValue(SPORK_20_SEGWIT_ACTIVATION) < block.nTime)) return error("CheckBlock() : CheckTransaction failed"); // double check that there are no double spent zOHMC spends in this block @@ -4717,10 +4717,10 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn // {0xaa, 0x21, 0xa9, 0xed}, and the following 32 bytes are SHA256(witness root, witness nonce). In case there are // multiple, the last one is used. bool fHaveWitness = false; - if (GetSporkValue(SPORK_19_SEGWIT_ACTIVATION) < pindexPrev->nTime) { + if (GetSporkValue(SPORK_20_SEGWIT_ACTIVATION) < pindexPrev->nTime) { int commitpos = GetWitnessCommitmentIndex(block); if (commitpos != -1) { - if (!IsSporkActive(SPORK_21_SEGWIT_ON_COINBASE)) { + if (!IsSporkActive(SPORK_22_SEGWIT_ON_COINBASE)) { if (fDebug) { LogPrintf("CheckBlock() : staking-on-segwit is not enabled.\n"); } @@ -5407,7 +5407,7 @@ bool RewindBlockIndex(const CChainParams& params) int nHeight = 1; while (nHeight <= chainActive.Height()) { - if (GetSporkValue(SPORK_19_SEGWIT_ACTIVATION) < chainActive[nHeight - 1]->nTime && !(chainActive[nHeight]->nStatus & BLOCK_OPT_WITNESS)) { + if (GetSporkValue(SPORK_20_SEGWIT_ACTIVATION) < chainActive[nHeight - 1]->nTime && !(chainActive[nHeight]->nStatus & BLOCK_OPT_WITNESS)) { break; } nHeight++; @@ -5430,7 +5430,7 @@ bool RewindBlockIndex(const CChainParams& params) // to disk before writing the chainstate, resulting in a failure to continue if interrupted. for (BlockMap::iterator it = mapBlockIndex.begin(); it != mapBlockIndex.end(); it++) { CBlockIndex* pindexIter = it->second; - if (GetSporkValue(SPORK_19_SEGWIT_ACTIVATION) < pindexIter->nTime && !(pindexIter->nStatus & BLOCK_OPT_WITNESS)) { + if (GetSporkValue(SPORK_20_SEGWIT_ACTIVATION) < pindexIter->nTime && !(pindexIter->nStatus & BLOCK_OPT_WITNESS)) { // Reduce validity pindexIter->nStatus = std::min(pindexIter->nStatus & BLOCK_VALID_MASK, BLOCK_VALID_TREE) | (pindexIter->nStatus & ~BLOCK_VALID_MASK); // Remove have-data flags. @@ -6212,7 +6212,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, // Ohmcoin: We use certain sporks during IBD, so check to see if they are // available. If not, ask the first peer connected for them. - bool fMissingSporks = !pSporkDB->SporkExists(SPORK_20_ZEROCOIN_MAINTENANCE_MODE); + bool fMissingSporks = !pSporkDB->SporkExists(SPORK_21_ZEROCOIN_MAINTENANCE_MODE); if (fMissingSporks || !fRequestedSporksIDB){ LogPrintf("asking peer for sporks\n"); @@ -6398,7 +6398,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, // doing this will result in the received block being rejected as an orphan in case it is // not a direct successor. if (State(pfrom->GetId())->fHaveWitness && - (GetSporkValue(SPORK_19_SEGWIT_ACTIVATION) > chainActive.Tip()->nTime || State(pfrom->GetId())->fHaveWitness)) { + (GetSporkValue(SPORK_20_SEGWIT_ACTIVATION) > chainActive.Tip()->nTime || State(pfrom->GetId())->fHaveWitness)) { inv.type = MSG_WITNESS_BLOCK; } vToFetch.push_back(inv); @@ -7024,8 +7024,23 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, // Those old clients won't react to the changes of the other (new) SPORK because at the time of their implementation // it was the one which was commented out int ActiveProtocol() + +// SPORK_17 was used for 71010. Leave it 'ON' so they don't see < 70711 nodes. They won't react to SPORK_15 + // messages because it's not in their code +/* + if (IsSporkActive(SPORK_16_NEW_PROTOCOL_ENFORCEMENT_3)) { + if (chainActive.Tip()->nHeight >= Params().ModifierUpgradeBlock()) + return MIN_PEER_PROTO_VERSION_AFTER_ENFORCEMENT; + } + return MIN_PEER_PROTO_VERSION_BEFORE_ENFORCEMENT; +*/ + + + // SPORK_17 is used for 71011. Nodes < 71010 won't see it and still get their protocol version via SPORK_17 and their + // own ModifierUpgradeBlock() + { - if (IsSporkActive(SPORK_16_NEW_PROTOCOL_ENFORCEMENT_3)) + if (IsSporkActive(SPORK_18_NEW_PROTOCOL_ENFORCEMENT_5)) return MIN_PEER_PROTO_VERSION_AFTER_ENFORCEMENT; return MIN_PEER_PROTO_VERSION_BEFORE_ENFORCEMENT; } @@ -7331,7 +7346,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle) NodeId staller = -1; FindNextBlocksToDownload(pto->GetId(), MAX_BLOCKS_IN_TRANSIT_PER_PEER - state.nBlocksInFlight, vToDownload, staller); BOOST_FOREACH(CBlockIndex *pindex, vToDownload) { - if (State(pto->GetId())->fHaveWitness || GetSporkValue(SPORK_19_SEGWIT_ACTIVATION) > pindex->pprev->nTime) { + if (State(pto->GetId())->fHaveWitness || GetSporkValue(SPORK_20_SEGWIT_ACTIVATION) > pindex->pprev->nTime) { vGetData.push_back(CInv(State(staller)->fHaveWitness ? MSG_WITNESS_BLOCK : MSG_BLOCK, pindex->GetBlockHash())); MarkBlockAsInFlight(pto->GetId(), pindex->GetBlockHash(), pindex); LogPrint("net", "Requesting block %s (%d) peer=%d\n", pindex->GetBlockHash().ToString(), diff --git a/src/miner.cpp b/src/miner.cpp index 3a9982f..0f7f528 100755 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -118,7 +118,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn, CWallet* pwallet, // -promiscuousmempoolflags is used. // TODO: replace this with a call to main to assess validity of a mempool // transaction (which in most cases can be a no-op). - bool fIncludeWitness = IsSporkActive(SPORK_19_SEGWIT_ACTIVATION); + bool fIncludeWitness = IsSporkActive(SPORK_20_SEGWIT_ACTIVATION); // Make sure to create the correct block version after zerocoin is enabled bool fZerocoinActive = chainActive.Height() >= Params().Zerocoin_StartHeight(); @@ -225,7 +225,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn, CWallet* pwallet, if (tx.IsCoinBase() || tx.IsCoinStake() || !IsFinalTx(tx, nHeight)){ continue; } - if(GetAdjustedTime() > GetSporkValue(SPORK_20_ZEROCOIN_MAINTENANCE_MODE) && tx.ContainsZerocoins()){ + if(GetAdjustedTime() > GetSporkValue(SPORK_21_ZEROCOIN_MAINTENANCE_MODE) && tx.ContainsZerocoins()){ continue; } diff --git a/src/ohmcoin-cli.cpp b/src/ohmcoin-cli.cpp index 5a59e61..08efa01 100644 --- a/src/ohmcoin-cli.cpp +++ b/src/ohmcoin-cli.cpp @@ -40,7 +40,7 @@ std::string HelpMessageCli() strUsage += HelpMessageOpt("-regtest", _("Enter regression test mode, which uses a special chain in which blocks can be " "solved instantly. This is intended for regression testing tools and app development.")); strUsage += HelpMessageOpt("-rpcconnect=", strprintf(_("Send commands to node running on (default: %s)"), "127.0.0.1")); - strUsage += HelpMessageOpt("-rpcport=", strprintf(_("Connect to JSON-RPC on (default: %u or testnet: %u)"), 11772, 11774)); + strUsage += HelpMessageOpt("-rpcport=", strprintf(_("Connect to JSON-RPC on (default: %u or testnet: %u)"), 52021, 11774)); strUsage += HelpMessageOpt("-rpcwait", _("Wait for RPC server to start")); strUsage += HelpMessageOpt("-rpcuser=", _("Username for JSON-RPC connections")); strUsage += HelpMessageOpt("-rpcpassword=", _("Password for JSON-RPC connections")); diff --git a/src/qt/phorestrings.cpp b/src/qt/ohmcoinstrings.cpp similarity index 100% rename from src/qt/phorestrings.cpp rename to src/qt/ohmcoinstrings.cpp diff --git a/src/qt/privacydialog.cpp b/src/qt/privacydialog.cpp index f7e4f4c..4c68c56 100755 --- a/src/qt/privacydialog.cpp +++ b/src/qt/privacydialog.cpp @@ -36,7 +36,7 @@ PrivacyDialog::PrivacyDialog(QWidget* parent) : QDialog(parent), ui->payTo->setAttribute(Qt::WA_MacShowFocusRect, 0); ui->addAsLabel->setAttribute(Qt::WA_MacShowFocusRect, 0); ui->zOHMCpayAmount->setAttribute(Qt::WA_MacShowFocusRect, 0); - + // "Spending 999999 zOHMC ought to be enough for anybody." - Bill Gates, 2017 ui->zOHMCpayAmount->setValidator( new QDoubleValidator(0.0, 21000000.0, 20, this) ); @@ -113,8 +113,8 @@ PrivacyDialog::PrivacyDialog(QWidget* parent) : QDialog(parent), ui->WarningLabel->hide(); // Explanatory text visible in QT-Creator ui->dummyHideWidget->hide(); // Dummy widget with elements to hide - // Set labels/buttons depending on SPORK_16 status - updateSPORK16Status(); + // Set labels/buttons depending on SPORK_18 status + updateSPORK18Status(); } PrivacyDialog::~PrivacyDialog() @@ -162,7 +162,7 @@ void PrivacyDialog::on_pushButtonMintzOHMC_clicked() if (!walletModel || !walletModel->getOptionsModel()) return; - if(GetAdjustedTime() > GetSporkValue(SPORK_20_ZEROCOIN_MAINTENANCE_MODE)) { + if(GetAdjustedTime() > GetSporkValue(SPORK_21_ZEROCOIN_MAINTENANCE_MODE)) { QMessageBox::information(this, tr("Mint Zerocoin"), tr("zOHMC is currently undergoing maintenance."), QMessageBox::Ok, QMessageBox::Ok); @@ -272,7 +272,7 @@ void PrivacyDialog::on_pushButtonSpendzOHMC_clicked() if (!walletModel || !walletModel->getOptionsModel() || !pwalletMain) return; - if(GetAdjustedTime() > GetSporkValue(SPORK_20_ZEROCOIN_MAINTENANCE_MODE)) { + if(GetAdjustedTime() > GetSporkValue(SPORK_21_ZEROCOIN_MAINTENANCE_MODE)) { QMessageBox::information(this, tr("Mint Zerocoin"), tr("zOHMC is currently undergoing maintenance."), QMessageBox::Ok, QMessageBox::Ok); return; @@ -644,8 +644,8 @@ void PrivacyDialog::setBalance(const CAmount& balance, const CAmount& unconfirme int64_t nImmature = 0; QString strDenomStats, strUnconfirmed = ""; - // Update/enable labels and buttons depending on the current SPORK_16 status - updateSPORK16Status(); + // Update/enable labels and buttons depending on the current SPORK_18 status + updateSPORK18Status(); for (const auto& denom : libzerocoin::zerocoinDenomList) { nCoins = libzerocoin::ZerocoinDenominationToInt(denom); @@ -735,11 +735,11 @@ void PrivacyDialog::keyPressEvent(QKeyEvent* event) } } -void PrivacyDialog::updateSPORK16Status() +void PrivacyDialog::updateSPORK18Status() { - // Update/enable labels, buttons and tooltips depending on the current SPORK_16 status + // Update/enable labels, buttons and tooltips depending on the current SPORK_18 status bool fButtonsEnabled = ui->pushButtonMintzOHMC->isEnabled(); - bool fMaintenanceMode = GetAdjustedTime() > GetSporkValue(SPORK_20_ZEROCOIN_MAINTENANCE_MODE); + bool fMaintenanceMode = GetAdjustedTime() > GetSporkValue(SPORK_21_ZEROCOIN_MAINTENANCE_MODE); if (fMaintenanceMode && fButtonsEnabled) { // Mint zOHMC ui->pushButtonMintzOHMC->setEnabled(false); diff --git a/src/qt/privacydialog.h b/src/qt/privacydialog.h index 14280cc..0faebb0 100644 --- a/src/qt/privacydialog.h +++ b/src/qt/privacydialog.h @@ -49,7 +49,7 @@ class PrivacyDialog : public QDialog void setZOhmcControlLabels(int64_t nAmount, int nQuantity); public slots: - void setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance, + void setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance, const CAmount& zerocoinBalance, const CAmount& unconfirmedZerocoinBalance, const CAmount& immatureZerocoinBalance, const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance); protected: @@ -70,7 +70,7 @@ public slots: CAmount currentWatchOnlyBalance; CAmount currentWatchUnconfBalance; CAmount currentWatchImmatureBalance; - + int nSecurityLevel = 0; bool fMinimizeChange = false; @@ -103,7 +103,7 @@ private slots: void on_pushButtonZOhmcControl_clicked(); void on_pasteButton_clicked(); void updateDisplayUnit(); - void updateSPORK16Status(); + void updateSPORK18Status(); }; #endif // BITCOIN_QT_PRIVACYDIALOG_H diff --git a/src/qt/res/css/default.css b/src/qt/res/css/default.css index ae78cc1..a569a64 100755 --- a/src/qt/res/css/default.css +++ b/src/qt/res/css/default.css @@ -960,16 +960,16 @@ QDialog#HelpMessageDialog QScrollBar:vertical, QDialog#HelpMessageDialog QScrollBar:horizontal { border: 0; } -/* About Phore Dialog */ +/* About Ohmcoin Dialog */ QDialog#AboutDialog QLabel#label, QDialog#AboutDialog QLabel#copyrightLabel, QDialog#AboutDialog QLabel#label_2 { - /* About Phore Contents */ + /* About Ohmcoin Contents */ margin-left: 10px; } QDialog#AboutDialog QLabel#label_2 { - /* Margin for About Phore text */ + /* Margin for About Ohmcoin text */ margin-right: 10px; } /* Edit Address Dialog */ diff --git a/src/qt/res/icons/overview_off.png b/src/qt/res/icons/overview_off.png index 215589c..316d38a 100644 Binary files a/src/qt/res/icons/overview_off.png and b/src/qt/res/icons/overview_off.png differ diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index 5f41165..ce420bb 100755 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -104,10 +104,10 @@ static const CRPCConvertParam vRPCConvertParams[] = {"setban", 2}, {"setban", 3}, {"spork", 1}, - {"mnbudget", 3}, - {"mnbudget", 4}, - {"mnbudget", 6}, - {"mnbudget", 8}, + {"knbudget", 3}, + {"knbudget", 4}, + {"knbudget", 6}, + {"knbudget", 8}, {"preparebudget", 2}, {"preparebudget", 3}, {"preparebudget", 5}, diff --git a/src/rpckarmanode-budget.cpp b/src/rpckarmanode-budget.cpp index 3d549f9..a8a52bb 100755 --- a/src/rpckarmanode-budget.cpp +++ b/src/rpckarmanode-budget.cpp @@ -47,7 +47,7 @@ void budgetToJSON(CBudgetProposal* pbudgetProposal, UniValue& bObj) // This command is retained for backwards compatibility, but is deprecated. // Future removal of this command is planned to keep things clean. -UniValue mnbudget(const UniValue& params, bool fHelp) +UniValue knbudget(const UniValue& params, bool fHelp) { string strCommand; if (params.size() >= 1) @@ -56,7 +56,7 @@ UniValue mnbudget(const UniValue& params, bool fHelp) if (fHelp || (strCommand != "vote-alias" && strCommand != "vote-many" && strCommand != "prepare" && strCommand != "submit" && strCommand != "vote" && strCommand != "getvotes" && strCommand != "getinfo" && strCommand != "show" && strCommand != "projection" && strCommand != "check" && strCommand != "nextblock")) throw runtime_error( - "mnbudget \"command\"... ( \"passphrase\" )\n" + "knbudget \"command\"... ( \"passphrase\" )\n" "\nVote or show current budgets\n" "This command is deprecated, please see individual command documentation for future reference\n\n" @@ -104,9 +104,9 @@ UniValue mnbudget(const UniValue& params, bool fHelp) if (strCommand == "vote-alias") throw runtime_error( "vote-alias is not supported with this command\n" - "Please use mnbudgetvote instead.\n" + "Please use knbudgetvote instead.\n" ); - return mnbudgetvote(params, fHelp); + return knbudgetvote(params, fHelp); } if (strCommand == "projection") { @@ -337,13 +337,13 @@ UniValue submitbudget(const UniValue& params, bool fHelp) throw runtime_error("Invalid proposal, see debug.log for details."); } -UniValue mnbudgetvote(const UniValue& params, bool fHelp) +UniValue knbudgetvote(const UniValue& params, bool fHelp) { std::string strCommand; if (params.size() >= 1) { strCommand = params[0].get_str(); - // Backwards compatibility with legacy `mnbudget` command + // Backwards compatibility with legacy `knbudget` command if (strCommand == "vote") strCommand = "local"; if (strCommand == "vote-many") strCommand = "many"; if (strCommand == "vote-alias") strCommand = "alias"; @@ -352,7 +352,7 @@ UniValue mnbudgetvote(const UniValue& params, bool fHelp) if (fHelp || (params.size() == 3 && (strCommand != "local" && strCommand != "many")) || (params.size() == 4 && strCommand != "alias") || params.size() > 4 || params.size() < 3) throw runtime_error( - "mnbudgetvote \"local|many|alias\" \"votehash\" \"yes|no\" ( \"alias\" )\n" + "knbudgetvote \"local|many|alias\" \"votehash\" \"yes|no\" ( \"alias\" )\n" "\nVote on a budget proposal\n" "\nArguments:\n" @@ -375,8 +375,8 @@ UniValue mnbudgetvote(const UniValue& params, bool fHelp) "}\n" "\nExamples:\n" + - HelpExampleCli("mnbudgetvote", "\"local\" \"ed2f83cedee59a91406f5f47ec4d60bf5a7f9ee6293913c82976bd2d3a658041\" \"yes\"") + - HelpExampleRpc("mnbudgetvote", "\"local\" \"ed2f83cedee59a91406f5f47ec4d60bf5a7f9ee6293913c82976bd2d3a658041\" \"yes\"")); + HelpExampleCli("knbudgetvote", "\"local\" \"ed2f83cedee59a91406f5f47ec4d60bf5a7f9ee6293913c82976bd2d3a658041\" \"yes\"") + + HelpExampleRpc("knbudgetvote", "\"local\" \"ed2f83cedee59a91406f5f47ec4d60bf5a7f9ee6293913c82976bd2d3a658041\" \"yes\"")); uint256 hash = ParseHashV(params[1], "parameter 1"); std::string strVote = params[2].get_str(); @@ -786,11 +786,11 @@ UniValue getbudgetinfo(const UniValue& params, bool fHelp) return ret; } -UniValue mnbudgetrawvote(const UniValue& params, bool fHelp) +UniValue knbudgetrawvote(const UniValue& params, bool fHelp) { if (fHelp || params.size() != 6) throw runtime_error( - "mnbudgetrawvote \"karmanode-tx-hash\" karmanode-tx-index \"proposal-hash\" yes|no time \"vote-sig\"\n" + "knbudgetrawvote \"karmanode-tx-hash\" karmanode-tx-index \"proposal-hash\" yes|no time \"vote-sig\"\n" "\nCompile and relay a proposal vote with provided external signature instead of signing vote internally\n" "\nArguments:\n" @@ -804,7 +804,7 @@ UniValue mnbudgetrawvote(const UniValue& params, bool fHelp) "\nResult:\n" "\"status\" (string) Vote status or error message\n" "\nExamples:\n" + - HelpExampleCli("mnbudgetrawvote", "") + HelpExampleRpc("mnbudgetrawvote", "")); + HelpExampleCli("knbudgetrawvote", "") + HelpExampleRpc("knbudgetrawvote", "")); uint256 hashMnTx = ParseHashV(params[0], "mn tx hash"); int nMnTxIndex = params[1].get_int(); @@ -849,7 +849,7 @@ UniValue mnbudgetrawvote(const UniValue& params, bool fHelp) } } -UniValue mnfinalbudget(const UniValue& params, bool fHelp) +UniValue knfinalbudget(const UniValue& params, bool fHelp) { string strCommand; if (params.size() >= 1) @@ -858,7 +858,7 @@ UniValue mnfinalbudget(const UniValue& params, bool fHelp) if (fHelp || (strCommand != "suggest" && strCommand != "vote-many" && strCommand != "vote" && strCommand != "show" && strCommand != "getvotes")) throw runtime_error( - "mnfinalbudget \"command\"... ( \"passphrase\" )\n" + "knfinalbudget \"command\"... ( \"passphrase\" )\n" "Vote or show current budgets\n" "\nAvailable commands:\n" " vote-many - Vote on a finalized budget\n" @@ -868,7 +868,7 @@ UniValue mnfinalbudget(const UniValue& params, bool fHelp) if (strCommand == "vote-many") { if (params.size() != 2) - throw runtime_error("Correct usage is 'mnfinalbudget vote-many BUDGET_HASH'"); + throw runtime_error("Correct usage is 'knfinalbudget vote-many BUDGET_HASH'"); std::string strHash = params[1].get_str(); uint256 hash(strHash); @@ -940,7 +940,7 @@ UniValue mnfinalbudget(const UniValue& params, bool fHelp) if (strCommand == "vote") { if (params.size() != 2) - throw runtime_error("Correct usage is 'mnfinalbudget vote BUDGET_HASH'"); + throw runtime_error("Correct usage is 'knfinalbudget vote BUDGET_HASH'"); std::string strHash = params[1].get_str(); uint256 hash(strHash); @@ -1003,7 +1003,7 @@ UniValue mnfinalbudget(const UniValue& params, bool fHelp) if (strCommand == "getvotes") { if (params.size() != 2) - throw runtime_error("Correct usage is 'mnbudget getvotes budget-hash'"); + throw runtime_error("Correct usage is 'knbudget getvotes budget-hash'"); std::string strHash = params[1].get_str(); uint256 hash(strHash); diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index 8dfa362..7dbfb40 100755 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -148,7 +148,7 @@ UniValue getinfo(const UniValue& params, bool fHelp) return obj; } -UniValue mnsync(const UniValue& params, bool fHelp) +UniValue knsync(const UniValue& params, bool fHelp) { std::string strMode; if (params.size() == 1) @@ -156,7 +156,7 @@ UniValue mnsync(const UniValue& params, bool fHelp) if (fHelp || params.size() != 1 || (strMode != "status" && strMode != "reset")) { throw runtime_error( - "mnsync \"status|reset\"\n" + "knsync \"status|reset\"\n" "\nReturns the sync status or resets sync.\n" "\nArguments:\n" @@ -185,7 +185,7 @@ UniValue mnsync(const UniValue& params, bool fHelp) "\nResult ('reset' mode):\n" "\"status\" (string) 'success'\n" "\nExamples:\n" + - HelpExampleCli("mnsync", "\"status\"") + HelpExampleRpc("mnsync", "\"status\"")); + HelpExampleCli("knsync", "\"status\"") + HelpExampleRpc("knsync", "\"status\"")); } if (strMode == "status") { @@ -635,7 +635,7 @@ UniValue getstakingstatus(const UniValue& params, bool fHelp) " \"walletunlocked\": true|false, (boolean) if the wallet is unlocked\n" " \"mintablecoins\": true|false, (boolean) if the wallet has mintable coins\n" " \"enoughcoins\": true|false, (boolean) if available coins are greater than reserve balance\n" - " \"mnsync\": true|false, (boolean) if karmanode data is synced\n" + " \"knsync\": true|false, (boolean) if karmanode data is synced\n" " \"staking status\": true|false, (boolean) if the wallet is staking or not\n" "}\n" "\nExamples:\n" + @@ -655,7 +655,7 @@ UniValue getstakingstatus(const UniValue& params, bool fHelp) obj.push_back(Pair("mintablecoins", pwalletMain->MintableCoins())); obj.push_back(Pair("enoughcoins", nReserveBalance <= pwalletMain->GetBalance())); } - obj.push_back(Pair("mnsync", karmanodeSync.IsSynced())); + obj.push_back(Pair("knsync", karmanodeSync.IsSynced())); bool nStaking = false; if (mapHashedBlocks.count(chainActive.Tip()->nHeight)) diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 9880343..0980071 100755 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -369,18 +369,18 @@ static const CRPCCommand vRPCCommands[] = {"ohmcoin", "getkarmanodestatus", &getkarmanodestatus, true, true, false}, {"ohmcoin", "getkarmanodewinners", &getkarmanodewinners, true, true, false}, {"ohmcoin", "getkarmanodescores", &getkarmanodescores, true, true, false}, - {"ohmcoin", "mnbudget", &mnbudget, true, true, false}, + {"ohmcoin", "knbudget", &knbudget, true, true, false}, {"ohmcoin", "preparebudget", &preparebudget, true, true, false}, {"ohmcoin", "submitbudget", &submitbudget, true, true, false}, - {"ohmcoin", "mnbudgetvote", &mnbudgetvote, true, true, false}, + {"ohmcoin", "knbudgetvote", &knbudgetvote, true, true, false}, {"ohmcoin", "getbudgetvotes", &getbudgetvotes, true, true, false}, {"ohmcoin", "getnextsuperblock", &getnextsuperblock, true, true, false}, {"ohmcoin", "getbudgetprojection", &getbudgetprojection, true, true, false}, {"ohmcoin", "getbudgetinfo", &getbudgetinfo, true, true, false}, - {"ohmcoin", "mnbudgetrawvote", &mnbudgetrawvote, true, true, false}, - {"ohmcoin", "mnfinalbudget", &mnfinalbudget, true, true, false}, + {"ohmcoin", "knbudgetrawvote", &knbudgetrawvote, true, true, false}, + {"ohmcoin", "knfinalbudget", &knfinalbudget, true, true, false}, {"ohmcoin", "checkbudgets", &checkbudgets, true, true, false}, - {"ohmcoin", "mnsync", &mnsync, true, true, false}, + {"ohmcoin", "knsync", &knsync, true, true, false}, {"ohmcoin", "spork", &spork, true, true, false}, {"ohmcoin", "getpoolinfo", &getpoolinfo, true, true, false}, {"ohmcoin", "makekeypair", &makekeypair, true, true, false}, @@ -622,7 +622,7 @@ std::string HelpExampleRpc(string methodname, string args) { return "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", " "\"method\": \"" + - methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:11772/\n"; + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:52021/\n"; } void RPCRegisterTimerInterface(RPCTimerInterface *iface) diff --git a/src/rpcserver.h b/src/rpcserver.h index 3175330..d82a81a 100755 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -314,20 +314,20 @@ extern UniValue getkarmanodestatus(const UniValue& params, bool fHelp); extern UniValue getkarmanodewinners(const UniValue& params, bool fHelp); extern UniValue getkarmanodescores(const UniValue& params, bool fHelp); -extern UniValue mnbudget(const UniValue& params, bool fHelp); // in rpckarmanode-budget.cpp +extern UniValue knbudget(const UniValue& params, bool fHelp); // in rpckarmanode-budget.cpp extern UniValue preparebudget(const UniValue& params, bool fHelp); extern UniValue submitbudget(const UniValue& params, bool fHelp); -extern UniValue mnbudgetvote(const UniValue& params, bool fHelp); +extern UniValue knbudgetvote(const UniValue& params, bool fHelp); extern UniValue getbudgetvotes(const UniValue& params, bool fHelp); extern UniValue getnextsuperblock(const UniValue& params, bool fHelp); extern UniValue getbudgetprojection(const UniValue& params, bool fHelp); extern UniValue getbudgetinfo(const UniValue& params, bool fHelp); -extern UniValue mnbudgetrawvote(const UniValue& params, bool fHelp); -extern UniValue mnfinalbudget(const UniValue& params, bool fHelp); +extern UniValue knbudgetrawvote(const UniValue& params, bool fHelp); +extern UniValue knfinalbudget(const UniValue& params, bool fHelp); extern UniValue checkbudgets(const UniValue& params, bool fHelp); extern UniValue getinfo(const UniValue& params, bool fHelp); // in rpcmisc.cpp -extern UniValue mnsync(const UniValue& params, bool fHelp); +extern UniValue knsync(const UniValue& params, bool fHelp); extern UniValue spork(const UniValue& params, bool fHelp); extern UniValue validateaddress(const UniValue& params, bool fHelp); extern UniValue createmultisig(const UniValue& params, bool fHelp); diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index f76cbf3..8f1f8ea 100755 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -1079,7 +1079,7 @@ UniValue addwitnessaddress(const UniValue& params, bool fHelp) throw runtime_error(msg); } - if (!IsSporkActive(SPORK_19_SEGWIT_ACTIVATION) && !GetBoolArg("-walletprematurewitness", false)) { + if (!IsSporkActive(SPORK_20_SEGWIT_ACTIVATION) && !GetBoolArg("-walletprematurewitness", false)) { throw JSONRPCError(RPC_WALLET_ERROR, "Segregated witness not enabled on network"); } @@ -2712,7 +2712,7 @@ UniValue mintzerocoin(const UniValue& params, bool fHelp) } int64_t nTime = GetTimeMillis(); - if(GetAdjustedTime() > GetSporkValue(SPORK_20_ZEROCOIN_MAINTENANCE_MODE)) + if(GetAdjustedTime() > GetSporkValue(SPORK_21_ZEROCOIN_MAINTENANCE_MODE)) throw JSONRPCError(RPC_WALLET_ERROR, "zOHMC is currently disabled due to maintenance."); EnsureWalletIsUnlocked(true); @@ -2820,7 +2820,7 @@ UniValue spendzerocoin(const UniValue& params, bool fHelp) LOCK2(cs_main, pwalletMain->cs_wallet); - if(GetAdjustedTime() > GetSporkValue(SPORK_20_ZEROCOIN_MAINTENANCE_MODE)) + if(GetAdjustedTime() > GetSporkValue(SPORK_21_ZEROCOIN_MAINTENANCE_MODE)) throw JSONRPCError(RPC_WALLET_ERROR, "zOHMC is currently disabled due to maintenance."); int64_t nTimeStart = GetTimeMillis(); diff --git a/src/spork.cpp b/src/spork.cpp index 6a0e539..c667594 100755 --- a/src/spork.cpp +++ b/src/spork.cpp @@ -131,10 +131,11 @@ int64_t GetSporkValue(int nSporkID) if (nSporkID == SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2) r = SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2_DEFAULT; if (nSporkID == SPORK_16_NEW_PROTOCOL_ENFORCEMENT_3) r = SPORK_16_NEW_PROTOCOL_ENFORCEMENT_3_DEFAULT; if (nSporkID == SPORK_17_NEW_PROTOCOL_ENFORCEMENT_4) r = SPORK_17_NEW_PROTOCOL_ENFORCEMENT_4_DEFAULT; - if (nSporkID == SPORK_18_MN_WINNER_MINIMUM_AGE) r = SPORK_18_MN_WINNER_MINIMUM_AGE_DEFAULT; - if (nSporkID == SPORK_19_SEGWIT_ACTIVATION) r = SPORK_19_SEGWIT_ACTIVATION_DEFAULT; - if (nSporkID == SPORK_20_ZEROCOIN_MAINTENANCE_MODE) r = SPORK_20_ZEROCOIN_MAINTENANCE_MODE_DEFAULT; - if (nSporkID == SPORK_21_SEGWIT_ON_COINBASE) r = SPORK_21_SEGWIT_ON_COINBASE_DEFAULT; + if (nSporkID == SPORK_18_NEW_PROTOCOL_ENFORCEMENT_5) r = SPORK_18_NEW_PROTOCOL_ENFORCEMENT_5_DEFAULT; + if (nSporkID == SPORK_19_MN_WINNER_MINIMUM_AGE) r = SPORK_19_MN_WINNER_MINIMUM_AGE_DEFAULT; + if (nSporkID == SPORK_20_SEGWIT_ACTIVATION) r = SPORK_20_SEGWIT_ACTIVATION_DEFAULT; + if (nSporkID == SPORK_21_ZEROCOIN_MAINTENANCE_MODE) r = SPORK_21_ZEROCOIN_MAINTENANCE_MODE_DEFAULT; + if (nSporkID == SPORK_22_SEGWIT_ON_COINBASE) r = SPORK_22_SEGWIT_ON_COINBASE_DEFAULT; if (r == -1) LogPrintf("GetSpork::Unknown Spork %d\n", nSporkID); @@ -276,10 +277,11 @@ int CSporkManager::GetSporkIDByName(std::string strName) if (strName == "SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2") return SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2; if (strName == "SPORK_16_NEW_PROTOCOL_ENFORCEMENT_3") return SPORK_16_NEW_PROTOCOL_ENFORCEMENT_3; if (strName == "SPORK_17_NEW_PROTOCOL_ENFORCEMENT_4") return SPORK_17_NEW_PROTOCOL_ENFORCEMENT_4; - if (strName == "SPORK_18_MN_WINNER_MINIMUM_AGE") return SPORK_18_MN_WINNER_MINIMUM_AGE; - if (strName == "SPORK_19_SEGWIT_ACTIVATION") return SPORK_19_SEGWIT_ACTIVATION; - if (strName == "SPORK_20_ZEROCOIN_MAINTENANCE_MODE") return SPORK_20_ZEROCOIN_MAINTENANCE_MODE; - if (strName == "SPORK_21_SEGWIT_ON_COINBASE") return SPORK_21_SEGWIT_ON_COINBASE_DEFAULT; + if (strName == "SPORK_18_NEW_PROTOCOL_ENFORCEMENT_5") return SPORK_18_NEW_PROTOCOL_ENFORCEMENT_5; + if (strName == "SPORK_19_MN_WINNER_MINIMUM_AGE") return SPORK_19_MN_WINNER_MINIMUM_AGE; + if (strName == "SPORK_20_SEGWIT_ACTIVATION") return SPORK_20_SEGWIT_ACTIVATION; + if (strName == "SPORK_21_ZEROCOIN_MAINTENANCE_MODE") return SPORK_21_ZEROCOIN_MAINTENANCE_MODE; + if (strName == "SPORK_22_SEGWIT_ON_COINBASE") return SPORK_22_SEGWIT_ON_COINBASE_DEFAULT; return -1; } @@ -298,10 +300,11 @@ std::string CSporkManager::GetSporkNameByID(int id) if (id == SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2) return "SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2"; if (id == SPORK_16_NEW_PROTOCOL_ENFORCEMENT_3) return "SPORK_16_NEW_PROTOCOL_ENFORCEMENT_3"; if (id == SPORK_17_NEW_PROTOCOL_ENFORCEMENT_4) return "SPORK_17_NEW_PROTOCOL_ENFORCEMENT_4"; - if (id == SPORK_18_MN_WINNER_MINIMUM_AGE) return "SPORK_18_MN_WINNER_MINIMUM_AGE"; - if (id == SPORK_19_SEGWIT_ACTIVATION) return "SPORK_19_SEGWIT_ACTIVATION"; - if (id == SPORK_20_ZEROCOIN_MAINTENANCE_MODE) return "SPORK_20_ZEROCOIN_MAINTENANCE_MODE"; - if (id == SPORK_21_SEGWIT_ON_COINBASE) return "SPORK_21_SEGWIT_ON_COINBASE"; + if (id == SPORK_18_NEW_PROTOCOL_ENFORCEMENT_5) return "SPORK_18_NEW_PROTOCOL_ENFORCEMENT_5"; + if (id == SPORK_19_MN_WINNER_MINIMUM_AGE) return "SPORK_19_MN_WINNER_MINIMUM_AGE"; + if (id == SPORK_20_SEGWIT_ACTIVATION) return "SPORK_20_SEGWIT_ACTIVATION"; + if (id == SPORK_21_ZEROCOIN_MAINTENANCE_MODE) return "SPORK_21_ZEROCOIN_MAINTENANCE_MODE"; + if (id == SPORK_22_SEGWIT_ON_COINBASE) return "SPORK_22_SEGWIT_ON_COINBASE"; return "Unknown"; } diff --git a/src/spork.h b/src/spork.h index 2d39212..edb420d 100755 --- a/src/spork.h +++ b/src/spork.h @@ -27,7 +27,7 @@ using namespace boost; Sporks 11,12, and 16 to be removed with 1st zerocoin release */ #define SPORK_START 10001 -#define SPORK_END 10020 +#define SPORK_END 10021 #define SPORK_2_SWIFTTX 10001 #define SPORK_3_SWIFTTX_BLOCK_FILTERING 10002 @@ -43,10 +43,11 @@ using namespace boost; #define SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2 10014 #define SPORK_16_NEW_PROTOCOL_ENFORCEMENT_3 10015 #define SPORK_17_NEW_PROTOCOL_ENFORCEMENT_4 10016 -#define SPORK_18_MN_WINNER_MINIMUM_AGE 10017 -#define SPORK_19_SEGWIT_ACTIVATION 10018 -#define SPORK_20_ZEROCOIN_MAINTENANCE_MODE 10019 -#define SPORK_21_SEGWIT_ON_COINBASE 10020 +#define SPORK_18_NEW_PROTOCOL_ENFORCEMENT_5 10017 +#define SPORK_19_MN_WINNER_MINIMUM_AGE 10018 +#define SPORK_20_SEGWIT_ACTIVATION 10019 +#define SPORK_21_ZEROCOIN_MAINTENANCE_MODE 10020 +#define SPORK_22_SEGWIT_ON_COINBASE 10021 #define SPORK_2_SWIFTTX_DEFAULT 978307200 //2001-1-1 #define SPORK_3_SWIFTTX_BLOCK_FILTERING_DEFAULT 1424217600 //2015-2-18 @@ -57,16 +58,17 @@ using namespace boost; #define SPORK_10_KARMANODE_PAY_UPDATED_NODES_DEFAULT 4070908800 //OFF //#define SPORK_11_LOCK_INVALID_UTXO_DEFAULT 4070908800 //OFF - NOTE: this is block height not time! #define SPORK_13_ENABLE_SUPERBLOCKS_DEFAULT 4070908800 //OFF -#define SPORK_14_NEW_PROTOCOL_ENFORCEMENT_DEFAULT 4070908800 //OFF -#define SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2_DEFAULT 4070908800 //OFF -#define SPORK_16_NEW_PROTOCOL_ENFORCEMENT_3_DEFAULT 4070908800 //OFF -#define SPORK_17_NEW_PROTOCOL_ENFORCEMENT_4_DEFAULT 4070908800 //OFF -#define SPORK_18_MN_WINNER_MINIMUM_AGE_DEFAULT 8000 // Age in seconds. This should be > KARMANODE_REMOVAL_SECONDS to avoid +#define SPORK_14_NEW_PROTOCOL_ENFORCEMENT_DEFAULT 4070908800 //ON +#define SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2_DEFAULT 4070908800 //ON +#define SPORK_16_NEW_PROTOCOL_ENFORCEMENT_3_DEFAULT 4070908800 //ON +#define SPORK_17_NEW_PROTOCOL_ENFORCEMENT_4_DEFAULT 4070908800 //ON +#define SPORK_18_NEW_PROTOCOL_ENFORCEMENT_5_DEFAULT 4070908800 //OFF +#define SPORK_19_MN_WINNER_MINIMUM_AGE_DEFAULT 8000 // Age in seconds. This should be > KARMANODE_REMOVAL_SECONDS to avoid // misconfigured new nodes in the list. // Set this to zero to emulate classic behaviour -#define SPORK_19_SEGWIT_ACTIVATION_DEFAULT 4070908800 //OFF -#define SPORK_20_ZEROCOIN_MAINTENANCE_MODE_DEFAULT 4070908800 //OFF -#define SPORK_21_SEGWIT_ON_COINBASE_DEFAULT 4070908800 //OFF +#define SPORK_20_SEGWIT_ACTIVATION_DEFAULT 4070908800 //OFF +#define SPORK_21_ZEROCOIN_MAINTENANCE_MODE_DEFAULT 4070908800 //OFF +#define SPORK_22_SEGWIT_ON_COINBASE_DEFAULT 4070908800 //OFF class CSporkMessage; class CSporkManager; diff --git a/src/test/test_phore.cpp b/src/test/test_ohmcoin.cpp similarity index 100% rename from src/test/test_phore.cpp rename to src/test/test_ohmcoin.cpp diff --git a/src/util.cpp b/src/util.cpp index 44d9288..1b944cb 100755 --- a/src/util.cpp +++ b/src/util.cpp @@ -244,7 +244,7 @@ bool LogAcceptCategory(const char* category) ptrCategory->insert(string("karmanode")); ptrCategory->insert(string("mnpayments")); ptrCategory->insert(string("zero")); - ptrCategory->insert(string("mnbudget")); + ptrCategory->insert(string("knbudget")); } } const set& setCategories = *ptrCategory.get(); diff --git a/src/version.h b/src/version.h index 87449a2..60a7837 100755 --- a/src/version.h +++ b/src/version.h @@ -21,8 +21,8 @@ static const int INIT_PROTO_VERSION = 209; static const int GETHEADERS_VERSION = 70077; //! disconnect from peers older than this proto version -static const int MIN_PEER_PROTO_VERSION_BEFORE_ENFORCEMENT = 70910; -static const int MIN_PEER_PROTO_VERSION_AFTER_ENFORCEMENT = 71010; +static const int MIN_PEER_PROTO_VERSION_BEFORE_ENFORCEMENT = 71010; +static const int MIN_PEER_PROTO_VERSION_AFTER_ENFORCEMENT = 71011; static const int MIN_PEER_VERSION_FIXED_SIGTIME = 70004; diff --git a/src/wallet.cpp b/src/wallet.cpp index 696a565..57ff578 100755 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -3965,7 +3965,7 @@ bool CWallet::GetDestData(const CTxDestination& dest, const std::string& key, st void CWallet::AutoZeromint() { // Don't bother Autominting if Zerocoin Protocol isn't active - if (GetAdjustedTime() > GetSporkValue(SPORK_20_ZEROCOIN_MAINTENANCE_MODE)) return; + if (GetAdjustedTime() > GetSporkValue(SPORK_21_ZEROCOIN_MAINTENANCE_MODE)) return; // Wait until blockchain + karmanodes are fully synced and wallet is unlocked. if (!karmanodeSync.IsSynced() || IsLocked()){ diff --git a/src/walletdb.cpp b/src/walletdb.cpp index 456ab96..11e9408 100755 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -442,7 +442,7 @@ bool ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, CW ssValue >> wtx; CValidationState state; // false because there is no reason to go through the zerocoin checks for our own wallet - if (!(CheckTransaction(wtx, false, false, state, IsSporkActive(SPORK_19_SEGWIT_ACTIVATION)) && (wtx.GetHash() == hash) && state.IsValid())) + if (!(CheckTransaction(wtx, false, false, state, IsSporkActive(SPORK_20_SEGWIT_ACTIVATION)) && (wtx.GetHash() == hash) && state.IsValid())) return false; // Undo serialize changes in 31600 @@ -1514,7 +1514,7 @@ std::list CWalletDB::ListSpentCoinsSerial() { std::list listPubCoin; std::list listCoins = ListSpentCoins(); - + for ( auto& coin : listCoins) { listPubCoin.push_back(coin.GetSerial()); } diff --git a/test/segwit.py b/test/segwit.py index 74642ad..fad6956 100644 --- a/test/segwit.py +++ b/test/segwit.py @@ -197,7 +197,7 @@ def run_test(self): # enable segwit through spork system for node in self.nodes: - node.spork("SPORK_19_SEGWIT_ACTIVATION", int(time.time() - 100)) + node.spork("SPORK_20_SEGWIT_ACTIVATION", int(time.time() - 100)) print("Verify previous witness txs skipped for mining can now be mined") assert_equal(len(self.nodes[2].getrawmempool()), 4) diff --git a/test/test_framework/util.py b/test/test_framework/util.py index 04ea455..d2da6fd 100644 --- a/test/test_framework/util.py +++ b/test/test_framework/util.py @@ -51,7 +51,7 @@ class PortSeed: def enable_mocktime(): #For backwared compatibility of the python scripts - #with previous versions of the cache, set MOCKTIME + #with previous versions of the cache, set MOCKTIME #to Jan 1, 2014 + (201 * 10 * 60) global MOCKTIME MOCKTIME = 1388534400 + (201 * 10 * 60) @@ -317,7 +317,7 @@ def start_node(i, dirname, extra_args=None, rpchost=None, timewait=None, binary= if extra_args is not None: args.extend(extra_args) ohmcoind_processes[i] = subprocess.Popen(args) if os.getenv("PYTHON_DEBUG", ""): - print("start_node: ohmcoed started, waiting for RPC to come up") + print("start_node: ohmcoind started, waiting for RPC to come up") url = rpc_url(i, rpchost) wait_for_ohmcoind_start(ohmcoind_processes[i], url, i) if os.getenv("PYTHON_DEBUG", ""):