Skip to content

Commit 86901e0

Browse files
Add OmniXEP burn address
1 parent 38f3a37 commit 86901e0

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

src/chainparams.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ class CMainParams : public CChainParams {
130130
consensus.mTreasuryPayees.emplace(CScript() << OP_0 << ParseHex("978a5064cd1fdf8c2510fe3fcbd65eaa5e98b32d"), 100); // 10% (full reward) for ep1qj799qexdrl0ccfgslcluh4j74f0f3vedatcv0k
131131
consensus.nTreasuryRewardPercentage = 10; // 10% of block reward goes to treasury
132132

133+
consensus.sBurnAddresses.emplace(CScript() << OP_DUP << OP_HASH160 << ParseHex("1fa15641f00f98b33a66054f11138a5fbe4d7058") << OP_EQUALVERIFY << OP_CHECKSIG); // PBURNomniXEPXXXXXXXXXXXXXXXXYZ2zjf
134+
133135
consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000004d4a27e34ba8c684ba2b");
134136
consensus.defaultAssumeValid = uint256S("0x5fbff547e15f6ad22cad7dad4a79dd5ed893552ea809a10400cc618e52a2be91"); // 450000
135137

@@ -265,6 +267,8 @@ class CTestNetParams : public CChainParams {
265267
consensus.mTreasuryPayees.emplace(CScript() << OP_0 << ParseHex("978a5064cd1fdf8c2510fe3fcbd65eaa5e98b32d"), 100); // 10% (full reward) for ep1qj799qexdrl0ccfgslcluh4j74f0f3vedatcv0k
266268
consensus.nTreasuryRewardPercentage = 10; // 10% of block reward goes to treasury
267269

270+
consensus.sBurnAddresses.emplace(CScript() << OP_DUP << OP_HASH160 << ParseHex("1fa15641f00f98b33a66054f11138a5fbe4d7058") << OP_EQUALVERIFY << OP_CHECKSIG); // PBURNomniXEPXXXXXXXXXXXXXXXXYZ2zjf
271+
268272
consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000000000030d440d4400");
269273
consensus.defaultAssumeValid = uint256S("0x4a121e7765837b21bcffad979e499ecbf7184fcbf772c34c481433059d0840f8"); // 200000
270274

@@ -436,6 +440,8 @@ class SigNetParams : public CChainParams {
436440
consensus.mTreasuryPayees.emplace(CScript() << OP_0 << ParseHex("978a5064cd1fdf8c2510fe3fcbd65eaa5e98b32d"), 100); // 10% (full reward) for ep1qj799qexdrl0ccfgslcluh4j74f0f3vedatcv0k
437441
consensus.nTreasuryRewardPercentage = 10; // 10% of block reward goes to treasury
438442

443+
consensus.sBurnAddresses.emplace(CScript() << OP_DUP << OP_HASH160 << ParseHex("1fa15641f00f98b33a66054f11138a5fbe4d7058") << OP_EQUALVERIFY << OP_CHECKSIG); // PBURNomniXEPXXXXXXXXXXXXXXXXYZ2zjf
444+
439445
// message start is defined as the first 4 bytes of the sha256d of the block script
440446
CHashWriter h(SER_DISK, 0);
441447
h << consensus.signet_challenge;
@@ -526,6 +532,8 @@ class CRegTestParams : public CChainParams {
526532
consensus.mTreasuryPayees.emplace(CScript() << OP_0 << ParseHex("978a5064cd1fdf8c2510fe3fcbd65eaa5e98b32d"), 100); // 10% (full reward) for ep1qj799qexdrl0ccfgslcluh4j74f0f3vedatcv0k
527533
consensus.nTreasuryRewardPercentage = 10; // 10% of block reward goes to treasury
528534

535+
consensus.sBurnAddresses.emplace(CScript() << OP_DUP << OP_HASH160 << ParseHex("1fa15641f00f98b33a66054f11138a5fbe4d7058") << OP_EQUALVERIFY << OP_CHECKSIG); // PBURNomniXEPXXXXXXXXXXXXXXXXYZ2zjf
536+
529537
consensus.nMinimumChainWork = uint256{};
530538
consensus.defaultAssumeValid = uint256{};
531539

src/coins.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include <coins.h>
66

7+
#include <chainparams.h>
78
#include <consensus/consensus.h>
89
#include <logging.h>
910
#include <random.h>
@@ -67,7 +68,7 @@ bool CCoinsViewCache::GetCoin(const COutPoint &outpoint, Coin &coin) const {
6768

6869
void CCoinsViewCache::AddCoin(const COutPoint &outpoint, Coin&& coin, bool possible_overwrite) {
6970
assert(!coin.IsSpent());
70-
if (coin.out.scriptPubKey.IsUnspendable() || coin.out.nValue == 0 || coin.out.scriptPubKey.empty()) return;
71+
if (coin.out.scriptPubKey.IsUnspendable() || coin.out.nValue == 0 || coin.out.scriptPubKey.empty() || Params().GetConsensus().sBurnAddresses.count(coin.out.scriptPubKey)) return;
7172
CCoinsMap::iterator it;
7273
bool inserted;
7374
std::tie(it, inserted) = cacheCoins.emplace(std::piecewise_construct, std::forward_as_tuple(outpoint), std::tuple<>());

src/consensus/params.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <uint256.h>
1212
#include <limits>
1313
#include <map>
14+
#include <set>
1415

1516
namespace Consensus {
1617

@@ -67,6 +68,7 @@ struct Params {
6768
int nTreasuryPaymentsCycleBlocks;
6869
std::map<CScript, unsigned int> mTreasuryPayees;
6970
unsigned int nTreasuryRewardPercentage;
71+
std::set<CScript> sBurnAddresses;
7072
/* Block hash that is excepted from BIP16 enforcement */
7173
uint256 BIP16Exception;
7274
/** Block height and hash at which BIP34 becomes active */

src/validation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,7 +1830,7 @@ DisconnectResult CChainState::DisconnectBlock(const CBlock& block, const CBlockI
18301830
// Check that all outputs are available and match the outputs in the block itself
18311831
// exactly.
18321832
for (size_t o = 0; o < tx.vout.size(); o++) {
1833-
if (!tx.vout[o].scriptPubKey.IsUnspendable() && tx.vout[o].nValue != 0 && !tx.vout[o].scriptPubKey.empty()) {
1833+
if (!tx.vout[o].scriptPubKey.IsUnspendable() && tx.vout[o].nValue != 0 && !tx.vout[o].scriptPubKey.empty() && !Params().GetConsensus().sBurnAddresses.count(tx.vout[o].scriptPubKey)) {
18341834
COutPoint out(hash, o);
18351835
Coin coin;
18361836
bool is_spent = view.SpendCoin(out, &coin);
@@ -2386,7 +2386,7 @@ bool CChainState::ConnectBlock(const CBlock& block, BlockValidationState& state,
23862386
}
23872387
nValueOut += tx.GetValueOut();
23882388
for (const CTxOut& tx_out : tx.vout) {
2389-
if (tx_out.scriptPubKey.IsUnspendable() || tx_out.scriptPubKey.empty())
2389+
if (tx_out.scriptPubKey.IsUnspendable() || tx_out.scriptPubKey.empty() || chainparams.GetConsensus().sBurnAddresses.count(tx_out.scriptPubKey))
23902390
nAmountBurned += tx_out.nValue;
23912391
}
23922392

0 commit comments

Comments
 (0)