From bfd9c0a5e08825fdf06237aa5b1dbb966ef3df59 Mon Sep 17 00:00:00 2001 From: Andy Oknen Date: Mon, 6 Mar 2023 23:29:03 +0800 Subject: [PATCH 1/5] General changes for lottery from BIP 100 --- src/pocketdb/consensus/Lottery.cpp | 52 ++++++++++++++++++++++++++++++ src/pocketdb/consensus/Lottery.h | 27 +++++++++++----- src/pos.cpp | 5 ++- 3 files changed, 75 insertions(+), 9 deletions(-) diff --git a/src/pocketdb/consensus/Lottery.cpp b/src/pocketdb/consensus/Lottery.cpp index 9918e3bfa..358c0dec4 100644 --- a/src/pocketdb/consensus/Lottery.cpp +++ b/src/pocketdb/consensus/Lottery.cpp @@ -202,6 +202,58 @@ namespace PocketConsensus return 0; } + // ---------------------------------------- + // Lottery checkpoint at 2162400 block + // Disable lottery payments for likes to comments. + // Also disable referral program + CAmount LotteryConsensus_bip_100::RatingReward(CAmount nCredit, opcodetype code) + { + if (code == OP_WINNER_POST) return nCredit * 0.025; + return 0; + } + + LotteryWinners& LotteryConsensus_bip_100::Winners(const CBlock& block, CDataStream& hashProofOfStakeSource) + { + auto reputationConsensus = PocketConsensus::ReputationConsensusFactoryInst.Instance(Height); + + map postCandidates; + + for (const auto& tx : block.vtx) + { + // Get destination address and score value + // In lottery allowed only likes to posts and comments + // Also in lottery allowed only positive scores + auto[parseScoreOk, scoreTxData] = TransactionHelper::ParseScore(tx); + if (!parseScoreOk) + continue; + + // BIP100: Only scores to content allowed + if (scoreTxData->ScoreType == ACTION_SCORE_CONTENT + && scoreTxData->ScoreValue != 4 && scoreTxData->ScoreValue != 5) + continue; + + auto scoreData = PocketDb::ConsensusRepoInst.GetScoreData(tx->GetHash().GetHex()); + if (!scoreData) + { + LogPrintf("%s: Failed get score data for tx: %s\n", __func__, tx->GetHash().GetHex()); + continue; + } + + if (!reputationConsensus->AllowModifyReputation( + scoreData, + true + )) + continue; + + postCandidates[scoreData->ContentAddressHash] += (scoreData->ScoreValue - 3); + } + + // Sort founded users + SortWinners(postCandidates, hashProofOfStakeSource, _winners.PostWinners); + + return _winners; + } + // ---------------------------------------- // Lottery checkpoint at _ block void LotteryConsensus_checkpoint_::ExtendReferrer(const ScoreDataDtoRef& scoreData, map& refs) diff --git a/src/pocketdb/consensus/Lottery.h b/src/pocketdb/consensus/Lottery.h index 777059d5a..c1b99349b 100644 --- a/src/pocketdb/consensus/Lottery.h +++ b/src/pocketdb/consensus/Lottery.h @@ -87,11 +87,21 @@ namespace PocketConsensus }; // --------------------------------------- - // Lottery checkpoint at _ block - class LotteryConsensus_checkpoint_ : public LotteryConsensus_checkpoint_1180000 + class LotteryConsensus_bip_100 : public LotteryConsensus_checkpoint_1180000 + { + protected: + int64_t MaxWinnersCount() { return 5; } override; + public: + explicit LotteryConsensus_bip_100(int height) : LotteryConsensus_checkpoint_1180000(height) {} + CAmount RatingReward(CAmount nCredit, opcodetype code) override; + LotteryWinners& Winners(const CBlock& block, CDataStream& hashProofOfStakeSource) override; + }; + + // --------------------------------------- + class LotteryConsensus_checkpoint_ : public LotteryConsensus_bip_100 { public: - explicit LotteryConsensus_checkpoint_(int height) : LotteryConsensus_checkpoint_1180000(height) {} + explicit LotteryConsensus_checkpoint_(int height) : LotteryConsensus_bip_100(height) {} protected: void ExtendReferrer(const ScoreDataDtoRef& scoreData, map& refs) override; void ExtendReferrers() override; @@ -103,11 +113,12 @@ namespace PocketConsensus { private: const vector> m_rules = { - {0, -1, -1, [](int height) { return make_shared(height); }}, - {514185, -1, -1, [](int height) { return make_shared(height); }}, - {1035000, -1, -1, [](int height) { return make_shared(height); }}, - {1124000, -1, -1, [](int height) { return make_shared(height); }}, - {1180000, 0, 0, [](int height) { return make_shared(height); }}, + {0, -1, -1, [](int height) { return make_shared(height); }}, + {514185, -1, -1, [](int height) { return make_shared(height); }}, + {1035000, -1, -1, [](int height) { return make_shared(height); }}, + {1124000, -1, -1, [](int height) { return make_shared(height); }}, + {1180000, 0, -1, [](int height) { return make_shared(height); }}, + {2162400, 1650652, 0, [](int height) { return make_shared(height); }}, }; public: shared_ptr Instance(int height) diff --git a/src/pos.cpp b/src/pos.cpp index 130b793ee..3dadf1214 100644 --- a/src/pos.cpp +++ b/src/pos.cpp @@ -651,8 +651,11 @@ bool GenerateOuts(CAmount nCredit, return true; CAmount ratingReward = lotteryInst->RatingReward(nCredit, type); - totalAmount += ratingReward; + if (ratingReward <= 0) + return true; + totalAmount += ratingReward; + int current = 0; const int rewardsCount = (int)winners.size(); CAmount rewardsPool = ratingReward; From 41ea7409f04bc01a2a64e3328a00b903911486aa Mon Sep 17 00:00:00 2001 From: Andy Oknen Date: Mon, 6 Mar 2023 23:38:51 +0800 Subject: [PATCH 2/5] BIP 100 link --- doc/bips.md | 40 ++-------------------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) diff --git a/doc/bips.md b/doc/bips.md index 88c6fdb01..91238c66c 100644 --- a/doc/bips.md +++ b/doc/bips.md @@ -1,39 +1,3 @@ -BIPs that are implemented by Pocketcoin Core (up-to-date up to **v0.17.0**): +BIPs that are implemented by Pocketcoin Core: -* [`BIP 9`](https://github.com/pocketcoin/bips/blob/master/bip-0009.mediawiki): The changes allowing multiple soft-forks to be deployed in parallel have been implemented since **v0.12.1** ([PR #7575](https://github.com/pocketcoin/pocketcoin/pull/7575)) -* [`BIP 11`](https://github.com/pocketcoin/bips/blob/master/bip-0011.mediawiki): Multisig outputs are standard since **v0.6.0** ([PR #669](https://github.com/pocketcoin/pocketcoin/pull/669)). -* [`BIP 13`](https://github.com/pocketcoin/bips/blob/master/bip-0013.mediawiki): The address format for P2SH addresses has been implemented since **v0.6.0** ([PR #669](https://github.com/pocketcoin/pocketcoin/pull/669)). -* [`BIP 14`](https://github.com/pocketcoin/bips/blob/master/bip-0014.mediawiki): The subversion string is being used as User Agent since **v0.6.0** ([PR #669](https://github.com/pocketcoin/pocketcoin/pull/669)). -* [`BIP 16`](https://github.com/pocketcoin/bips/blob/master/bip-0016.mediawiki): The pay-to-script-hash evaluation rules have been implemented since **v0.6.0**, and took effect on *April 1st 2012* ([PR #748](https://github.com/pocketcoin/pocketcoin/pull/748)). -* [`BIP 21`](https://github.com/pocketcoin/bips/blob/master/bip-0021.mediawiki): The URI format for Pocketcoin payments has been implemented since **v0.6.0** ([PR #176](https://github.com/pocketcoin/pocketcoin/pull/176)). -* [`BIP 22`](https://github.com/pocketcoin/bips/blob/master/bip-0022.mediawiki): The 'getblocktemplate' (GBT) RPC protocol for mining has been implemented since **v0.7.0** ([PR #936](https://github.com/pocketcoin/pocketcoin/pull/936)). -* [`BIP 23`](https://github.com/pocketcoin/bips/blob/master/bip-0023.mediawiki): Some extensions to GBT have been implemented since **v0.10.0rc1**, including longpolling and block proposals ([PR #1816](https://github.com/pocketcoin/pocketcoin/pull/1816)). -* [`BIP 30`](https://github.com/pocketcoin/bips/blob/master/bip-0030.mediawiki): The evaluation rules to forbid creating new transactions with the same txid as previous not-fully-spent transactions were implemented since **v0.6.0**, and the rule took effect on *March 15th 2012* ([PR #915](https://github.com/pocketcoin/pocketcoin/pull/915)). -* [`BIP 31`](https://github.com/pocketcoin/bips/blob/master/bip-0031.mediawiki): The 'pong' protocol message (and the protocol version bump to 60001) has been implemented since **v0.6.1** ([PR #1081](https://github.com/pocketcoin/pocketcoin/pull/1081)). -* [`BIP 32`](https://github.com/pocketcoin/bips/blob/master/bip-0032.mediawiki): Hierarchical Deterministic Wallets has been implemented since **v0.13.0** ([PR #8035](https://github.com/pocketcoin/pocketcoin/pull/8035)). -* [`BIP 34`](https://github.com/pocketcoin/bips/blob/master/bip-0034.mediawiki): The rule that requires blocks to contain their height (number) in the coinbase input, and the introduction of version 2 blocks has been implemented since **v0.7.0**. The rule took effect for version 2 blocks as of *block 224413* (March 5th 2013), and version 1 blocks are no longer allowed since *block 227931* (March 25th 2013) ([PR #1526](https://github.com/pocketcoin/pocketcoin/pull/1526)). -* [`BIP 35`](https://github.com/pocketcoin/bips/blob/master/bip-0035.mediawiki): The 'mempool' protocol message (and the protocol version bump to 60002) has been implemented since **v0.7.0** ([PR #1641](https://github.com/pocketcoin/pocketcoin/pull/1641)). -* [`BIP 37`](https://github.com/pocketcoin/bips/blob/master/bip-0037.mediawiki): The bloom filtering for transaction relaying, partial Merkle trees for blocks, and the protocol version bump to 70001 (enabling low-bandwidth SPV clients) has been implemented since **v0.8.0** ([PR #1795](https://github.com/pocketcoin/pocketcoin/pull/1795)). -* [`BIP 42`](https://github.com/pocketcoin/bips/blob/master/bip-0042.mediawiki): The bug that would have caused the subsidy schedule to resume after block 13440000 was fixed in **v0.9.2** ([PR #3842](https://github.com/pocketcoin/pocketcoin/pull/3842)). -* [`BIP 61`](https://github.com/pocketcoin/bips/blob/master/bip-0061.mediawiki): The 'reject' protocol message (and the protocol version bump to 70002) was added in **v0.9.0** ([PR #3185](https://github.com/pocketcoin/pocketcoin/pull/3185)). Starting *v0.17.0*, whether to send reject messages can be configured with the `-enablebip61` option. -* [`BIP 65`](https://github.com/pocketcoin/bips/blob/master/bip-0065.mediawiki): The CHECKLOCKTIMEVERIFY softfork was merged in **v0.12.0** ([PR #6351](https://github.com/pocketcoin/pocketcoin/pull/6351)), and backported to **v0.11.2** and **v0.10.4**. Mempool-only CLTV was added in [PR #6124](https://github.com/pocketcoin/pocketcoin/pull/6124). -* [`BIP 66`](https://github.com/pocketcoin/bips/blob/master/bip-0066.mediawiki): The strict DER rules and associated version 3 blocks have been implemented since **v0.10.0** ([PR #5713](https://github.com/pocketcoin/pocketcoin/pull/5713)). -* [`BIP 68`](https://github.com/pocketcoin/bips/blob/master/bip-0068.mediawiki): Sequence locks have been implemented as of **v0.12.1** ([PR #7184](https://github.com/pocketcoin/pocketcoin/pull/7184)), and have been activated since *block 419328*. -* [`BIP 70`](https://github.com/pocketcoin/bips/blob/master/bip-0070.mediawiki) [`71`](https://github.com/pocketcoin/bips/blob/master/bip-0071.mediawiki) [`72`](https://github.com/pocketcoin/bips/blob/master/bip-0072.mediawiki): Payment Protocol support has been available in Pocketcoin Core GUI since **v0.9.0** ([PR #5216](https://github.com/pocketcoin/pocketcoin/pull/5216)). -* [`BIP 90`](https://github.com/pocketcoin/bips/blob/master/bip-0090.mediawiki): Trigger mechanism for activation of BIPs 34, 65, and 66 has been simplified to block height checks since **v0.14.0** ([PR #8391](https://github.com/pocketcoin/pocketcoin/pull/8391)). -* [`BIP 111`](https://github.com/pocketcoin/bips/blob/master/bip-0111.mediawiki): `NODE_BLOOM` service bit added, and enforced for all peer versions as of **v0.13.0** ([PR #6579](https://github.com/pocketcoin/pocketcoin/pull/6579) and [PR #6641](https://github.com/pocketcoin/pocketcoin/pull/6641)). -* [`BIP 112`](https://github.com/pocketcoin/bips/blob/master/bip-0112.mediawiki): The CHECKSEQUENCEVERIFY opcode has been implemented since **v0.12.1** ([PR #7524](https://github.com/pocketcoin/pocketcoin/pull/7524)) and has been activated since *block 419328*. -* [`BIP 113`](https://github.com/pocketcoin/bips/blob/master/bip-0113.mediawiki): Median time past lock-time calculations have been implemented since **v0.12.1** ([PR #6566](https://github.com/pocketcoin/pocketcoin/pull/6566)) and have been activated since *block 419328*. -* [`BIP 125`](https://github.com/pocketcoin/bips/blob/master/bip-0125.mediawiki): Opt-in full replace-by-fee signaling honoured in mempool and mining as of **v0.12.0** ([PR 6871](https://github.com/pocketcoin/pocketcoin/pull/6871)). -* [`BIP 130`](https://github.com/pocketcoin/bips/blob/master/bip-0130.mediawiki): direct headers announcement is negotiated with peer versions `>=70012` as of **v0.12.0** ([PR 6494](https://github.com/pocketcoin/pocketcoin/pull/6494)). -* [`BIP 133`](https://github.com/pocketcoin/bips/blob/master/bip-0133.mediawiki): feefilter messages are respected and sent for peer versions `>=70013` as of **v0.13.0** ([PR 7542](https://github.com/pocketcoin/pocketcoin/pull/7542)). -* [`BIP 141`](https://github.com/pocketcoin/bips/blob/master/bip-0141.mediawiki): Segregated Witness (Consensus Layer) as of **v0.13.0** ([PR 8149](https://github.com/pocketcoin/pocketcoin/pull/8149)), and defined for mainnet as of **v0.13.1** ([PR 8937](https://github.com/pocketcoin/pocketcoin/pull/8937)). -* [`BIP 143`](https://github.com/pocketcoin/bips/blob/master/bip-0143.mediawiki): Transaction Signature Verification for Version 0 Witness Program as of **v0.13.0** ([PR 8149](https://github.com/pocketcoin/pocketcoin/pull/8149)) and defined for mainnet as of **v0.13.1** ([PR 8937](https://github.com/pocketcoin/pocketcoin/pull/8937)). -* [`BIP 144`](https://github.com/pocketcoin/bips/blob/master/bip-0144.mediawiki): Segregated Witness as of **0.13.0** ([PR 8149](https://github.com/pocketcoin/pocketcoin/pull/8149)). -* [`BIP 145`](https://github.com/pocketcoin/bips/blob/master/bip-0145.mediawiki): getblocktemplate updates for Segregated Witness as of **v0.13.0** ([PR 8149](https://github.com/pocketcoin/pocketcoin/pull/8149)). -* [`BIP 147`](https://github.com/pocketcoin/bips/blob/master/bip-0147.mediawiki): NULLDUMMY softfork as of **v0.13.1** ([PR 8636](https://github.com/pocketcoin/pocketcoin/pull/8636) and [PR 8937](https://github.com/pocketcoin/pocketcoin/pull/8937)). -* [`BIP 152`](https://github.com/pocketcoin/bips/blob/master/bip-0152.mediawiki): Compact block transfer and related optimizations are used as of **v0.13.0** ([PR 8068](https://github.com/pocketcoin/pocketcoin/pull/8068)). -* [`BIP 159`](https://github.com/pocketcoin/bips/blob/master/bip-0159.mediawiki): NODE_NETWORK_LIMITED service bit [signaling only] is supported as of **v0.16.0** ([PR 11740](https://github.com/pocketcoin/pocketcoin/pull/11740)). -* [`BIP 173`](https://github.com/pocketcoin/bips/blob/master/bip-0173.mediawiki): Bech32 addresses for native Segregated Witness outputs are supported as of **v0.16.0** ([PR 11167](https://github.com/pocketcoin/pocketcoin/pull/11167)). -* [`BIP 174`](https://github.com/pocketcoin/bips/blob/master/bip-0174.mediawiki): RPCs to operate on Partially Signed Pocketcoin Transactions (PSBT) are present as of **v0.17.0** ([PR 13557](https://github.com/pocketcoin/pocketcoin/pull/13557)). -* [`BIP 176`](https://github.com/pocketcoin/bips/blob/master/bip-0176.mediawiki): Bits Denomination [QT only] is supported as of **v0.16.0** ([PR 12035](https://github.com/pocketcoin/pocketcoin/pull/12035)). +* [`BIP 100`](): Changes in the policy of emission payments. ([PR #563](https://github.com/pocketnetteam/pocketnet.core/wiki/BIP-100:-Changes-in-emission-payments)) From f8327e5101bb987ce98ef2b31859594577984095 Mon Sep 17 00:00:00 2001 From: Andy Oknen Date: Mon, 6 Mar 2023 23:44:48 +0800 Subject: [PATCH 3/5] Fix typo --- src/pocketdb/consensus/Lottery.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketdb/consensus/Lottery.h b/src/pocketdb/consensus/Lottery.h index c1b99349b..277f168ab 100644 --- a/src/pocketdb/consensus/Lottery.h +++ b/src/pocketdb/consensus/Lottery.h @@ -90,7 +90,7 @@ namespace PocketConsensus class LotteryConsensus_bip_100 : public LotteryConsensus_checkpoint_1180000 { protected: - int64_t MaxWinnersCount() { return 5; } override; + int64_t MaxWinnersCount() override { return 5; }; public: explicit LotteryConsensus_bip_100(int height) : LotteryConsensus_checkpoint_1180000(height) {} CAmount RatingReward(CAmount nCredit, opcodetype code) override; From f7db56eebfa4ae9f96c396eee2a66c7cd2b5555b Mon Sep 17 00:00:00 2001 From: Andy Oknen Date: Wed, 8 Mar 2023 02:58:06 +0800 Subject: [PATCH 4/5] Test for lottery changes --- test/functional/pocketnet/lottery.py | 139 +++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 test/functional/pocketnet/lottery.py diff --git a/test/functional/pocketnet/lottery.py b/test/functional/pocketnet/lottery.py new file mode 100644 index 000000000..37b94cabb --- /dev/null +++ b/test/functional/pocketnet/lottery.py @@ -0,0 +1,139 @@ +#!/usr/bin/env python3 +# Copyright (c) 2023 The Pocketnet developers +# Distributed under the Apache 2.0 software license, see the accompanying +# https://www.apache.org/licenses/LICENSE-2.0 +""" +A Badges additional table functional test +Launch this with command from 'test/functional/pocketnet' directory +""" + +import sys +import pathlib + +sys.path.insert(0, str(pathlib.Path(__file__).parent.parent)) + +# Avoid wildcard * imports +from test_framework.test_framework import PocketcoinTestFramework + +# Pocketnet framework +from framework.helpers import generate_accounts, rollback_node +from framework.models import * + + +class ModerationJuryTest(PocketcoinTestFramework): + def set_test_params(self): + self.setup_clean_chain = True + self.num_nodes = 1 + self.extra_args = [["-debug=consensus"]] + + def run_test(self): + """Main test logic""" + node = self.nodes[0] + pubGenTx = node.public().generatetransaction + + # --------------------------------------------------------------------------------- + + self.log.info("Generate general node address") + nodeAddress = node.getnewaddress() + + self.log.info("Generate first coinbase 1020 blocks") + node.generatetoaddress(1020, nodeAddress) # height : 1020 + + self.log.info("Node balance: %s", node.public().getaddressinfo(nodeAddress)) + + # --------------------------------------------------------------------------------- + self.log.info("Generate account addresses") + accounts = generate_accounts(node, nodeAddress, account_num=10) # height : 1021 + + # --------------------------------------------------------------------------------- + self.log.info("Generate post for set scores") + + # Create account + fakeAcc = node.public().generateaddress() + fakeAcc = Account(fakeAcc["address"], fakeAcc["privkey"], "fake") + node.sendtoaddress(address=fakeAcc.Address, amount=1, destaddress=nodeAddress) + node.sendtoaddress(address=fakeAcc.Address, amount=1, destaddress=nodeAddress) + node.stakeblock(1) # height : 1022 + fakeAccTx = pubGenTx( + fakeAcc, + AccountPayload(fakeAcc.Name, "image", "en", "about", "s", "b", "pubkey"), + 1, + 0, + ) + node.stakeblock(1) # height : 1023 + fakePostTx = pubGenTx(fakeAcc, ContentPostPayload(), 1, 0) + node.stakeblock(2) # height : 1025 + + # --------------------------------------------------------------------------------- + self.log.info("Register accounts") + + for acc in accounts: + pubGenTx( + acc, + AccountPayload(acc.Name, "image", "en", "about", "s", "b", "pubkey"), + 1000, + 0, + ) + + node.stakeblock(20) # height : 1045 + + for acc in accounts: + assert "shark" in node.public().getuserstate(acc.Address)["badges"] + + self.log.info("Set score (5) to fakePost for check lottery payment") + for acc in accounts: + pubGenTx( + acc, + ScoreContentPayload(fakePostTx, 5, fakeAcc.Address), + ) + + node.stakeblock(2) # height : 1047 + + bestBlock = node.getblockchaininfo()['bestblockhash'] + lastCoinstakeTx = node.getblock(bestBlock)['tx'][1] + assert node.public().gettransactions(lastCoinstakeTx)[0]['vout'][0]['scriptPubKey']['hex'] == 'c0' + + # --------------------------------------------------------------------------------- + self.log.info("Create comments from all acounts and like all accounts") + + # Create comments from moderators + for acc in accounts: + acc.badgeComment = pubGenTx(acc, CommentPayload(fakePostTx)) + node.stakeblock(1) # height : 1048 + + # Like another for set comment liker + for i in range(len(accounts)): + accTo = accounts[0 if i == len(accounts) - 1 else i + 1] + pubGenTx( + accounts[i], + ScoreCommentPayload(accTo.badgeComment, 1, accTo.Address), + ) + + # Stake for nearest Badge update period + # /src/pocketdb/consensus/Base.h:326 + node.stakeblock(52) # height : 1100 + + # Check moderator badges + for acc in accounts: + assert "shark" in node.public().getuserstate(acc.Address)["badges"] + + self.log.info("Generate another post for set scores") + fakePostTx = pubGenTx(fakeAcc, ContentPostPayload(), 1, 0) + node.stakeblock(1) # height : 1101 + + self.log.info("Set score (4) to fakePost for check lottery payment") + for acc in accounts: + pubGenTx( + acc, + ScoreContentPayload(fakePostTx, 4, fakeAcc.Address), + ) + + node.stakeblock(2) # height : 1103 + + bestBlock = node.getblockchaininfo()['bestblockhash'] + lastCoinstakeTx = node.getblock(bestBlock)['tx'][1] + assert node.public().gettransactions(lastCoinstakeTx)[0]['vout'][0]['scriptPubKey']['hex'] == 'c0' + + +if __name__ == "__main__": + ModerationJuryTest().main() From 322192852ae6eeff624152f309382b3c1f103273 Mon Sep 17 00:00:00 2001 From: Andy Oknen Date: Thu, 9 Mar 2023 20:36:13 +0800 Subject: [PATCH 5/5] Fix winners for exclude scores to comments --- src/pocketdb/consensus/Lottery.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pocketdb/consensus/Lottery.cpp b/src/pocketdb/consensus/Lottery.cpp index 358c0dec4..a5c69d0a6 100644 --- a/src/pocketdb/consensus/Lottery.cpp +++ b/src/pocketdb/consensus/Lottery.cpp @@ -228,6 +228,8 @@ namespace PocketConsensus continue; // BIP100: Only scores to content allowed + if (scoreTxData->ScoreType == ACTION_SCORE_COMMENT) + continue; if (scoreTxData->ScoreType == ACTION_SCORE_CONTENT && scoreTxData->ScoreValue != 4 && scoreTxData->ScoreValue != 5) continue;