@@ -42,7 +42,6 @@ Genesis block for RegTest found
4242#include < utils/utilstrencodings.h>
4343#include < utils/arith_uint256.h>
4444#include < key_io.h>
45- #include < main.h>
4645#include < net.h>
4746#include < netmsg/netconsts.h>
4847#include < crypto/equihash.h>
@@ -350,6 +349,20 @@ static CBlock CreateRegtestGenesisBlock()
350349 return block;
351350}
352351
352+ bool CChainParams::DecodePastelBurnAddress ()
353+ {
354+ KeyIO keyIO (*this );
355+ ScriptType scriptType;
356+ const CTxDestination dest = keyIO.DecodeDestination (m_sPastelBurnAddress);
357+ return GetTxDestinationHash (dest, m_pastelBurnAddressHash, scriptType);
358+ }
359+
360+ constexpr size_t equihash_parameters_acceptable (const int N, const int K) noexcept
361+ {
362+ return ((CBlockHeader::HEADER_SIZE + equihash_solution_size (N, K)) * MAX_HEADERS_RESULTS < \
363+ MAX_PROTOCOL_MESSAGE_LENGTH - 1000 );
364+ }
365+
353366/* *
354367 * Main network
355368 */
@@ -703,6 +716,8 @@ class CRegTestParams : public CChainParams
703716 {
704717 strNetworkID = " regtest" ;
705718 strCurrencyUnits = " REG" ;
719+ // cUUjBtKN8BRriP1STe1KkEhJUpdARf8tj9T5gKuJPuY5mjtd2jP5
720+ m_sPastelBurnAddress = " tPotfXKvYRAmJepR8rm849pRP2nmbyt2bGu" ;
706721 bip44CoinType = 1 ;
707722 consensus.nSubsidyHalvingInterval = 150 ;
708723 consensus.nMajorityEnforceBlockUpgrade = 750 ;
@@ -740,7 +755,6 @@ class CRegTestParams : public CChainParams
740755 pchMessageStart[1 ] = 0xd8 ;
741756 pchMessageStart[2 ] = 0xfa ;
742757 pchMessageStart[3 ] = 0x9e ;
743- // vAlertPubKey = ParseHex("04b985ccafe6d17ac5d84cb8c06a69cefad733ee96b4b93bcf5ef0897778c227ee7e74e7680cc219236e4c6a609dbcdeb5bf65cea9c2576c2a0fbef590657c8e7a");
744758 vAlertPubKey = ParseHex (" 04d8a5b9bf6ef2396204fc879d370c85b3ccd665b6a06b9600165ceed4233ca38d27010abd3b6e607b46663ce21e8473df0e30f1bf7e425a3bdd58d2a6d1bb2049" );
745759 nDefaultPort = REGTEST_DEFAULT_PORT;
746760 m_nPruneAfterHeight = 1000 ;
@@ -836,6 +850,8 @@ unique_ptr<const CChainParams> CreateChainParams(const ChainNetwork network)
836850 ChainParams = make_unique<CMainParams>();
837851 break ;
838852 }
853+ if (ChainParams)
854+ ChainParams->DecodePastelBurnAddress ();
839855 return std::move (ChainParams);
840856}
841857
0 commit comments