diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 77195ffcf..a86c68ebb 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -136,7 +136,7 @@ public: consensus.nExtendedClaimExpirationForkHeight = 400155; consensus.fPowAllowMinDifficultyBlocks = false; consensus.fPowNoRetargeting = false; - consensus.nNormalizedNameForkHeight = 1000000; // FIXME: pick a real fork height + consensus.nNormalizedNameForkHeight = 539940; // targeting 21 March 2019 consensus.nRuleChangeActivationThreshold = 1916; // 95% of 2016 consensus.nMinerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28; @@ -224,7 +224,7 @@ public: consensus.nExtendedClaimExpirationForkHeight = 278160; consensus.fPowAllowMinDifficultyBlocks = true; consensus.fPowNoRetargeting = false; - consensus.nNormalizedNameForkHeight = 1000000; // FIXME: pick a real fork height + consensus.nNormalizedNameForkHeight = 993380; // targeting, 21 Feb 2019 consensus.nRuleChangeActivationThreshold = 1512; // 75% for testchains consensus.nMinerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28; @@ -305,7 +305,7 @@ public: consensus.nExtendedClaimExpirationForkHeight = 800; consensus.fPowAllowMinDifficultyBlocks = false; consensus.fPowNoRetargeting = false; - consensus.nNormalizedNameForkHeight = 2000; + consensus.nNormalizedNameForkHeight = 250; // SDK depends upon this number consensus.nRuleChangeActivationThreshold = 108; // 75% for testchains consensus.nMinerConfirmationWindow = 144; // Faster than normal for regtest (144 instead of 2016) consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28; diff --git a/src/claimtrieforks.cpp b/src/claimtrieforks.cpp index 9ae15748d..0d8dc536c 100644 --- a/src/claimtrieforks.cpp +++ b/src/claimtrieforks.cpp @@ -138,10 +138,9 @@ std::string CClaimTrieCacheNormalizationFork::normalizeClaimName(const std::stri if (normalized.empty()) return name; + // these methods supposedly only use the "UTF8" portion of the locale object: normalized = boost::locale::normalize(normalized, boost::locale::norm_nfd, utf8); - - // Locale aware lowercase (the non-locale-aware version seemed to struggle with some international chars): - normalized = boost::locale::to_lower(normalized, utf8); + normalized = boost::locale::fold_case(normalized, utf8); } catch (const boost::locale::conv::conversion_error& e){ return name; diff --git a/src/rpc/claimtrie.cpp b/src/rpc/claimtrie.cpp index 0e69395f2..bb90a5ed7 100644 --- a/src/rpc/claimtrie.cpp +++ b/src/rpc/claimtrie.cpp @@ -532,7 +532,9 @@ UniValue getclaimbyid(const UniValue& params, bool fHelp) CCoinsViewCache coins(pcoinsTip); getValueForClaim(coins, claimValue.outPoint, sValue); claim.push_back(Pair("name", name)); - claim.push_back(Pair("normalized_name", cache.normalizeClaimName(name, true))); + if (cache.shouldNormalize()) + claim.push_back(Pair("normalized_name", cache.normalizeClaimName(name, true))); + claim.push_back(Pair("value", sValue)); claim.push_back(Pair("claimId", claimValue.claimId.GetHex())); claim.push_back(Pair("txid", claimValue.outPoint.hash.GetHex())); @@ -636,6 +638,7 @@ UniValue getclaimsfortx(const UniValue& params, bool fHelp) " \"nOut\" (numeric) the index of the claim or support in the transaction's list out outputs\n" " \"claim type\" (string) 'claim' or 'support'\n" " \"name\" (string) the name claimed or supported\n" + " \"claimId\" (string) if a claim, its ID\n" " \"value\" (string) if a name claim, the value of the claim\n" " \"supported txid\" (string) if a support, the txid of the supported claim\n" " \"supported nout\" (numeric) if a support, the index of the supported claim in its transaction\n" diff --git a/src/test/claimtriebranching_tests.cpp b/src/test/claimtriebranching_tests.cpp index 589e05f62..4561f00c1 100644 --- a/src/test/claimtriebranching_tests.cpp +++ b/src/test/claimtriebranching_tests.cpp @@ -136,6 +136,7 @@ struct ClaimTrieChainFixture{ ENTER_CRITICAL_SECTION(cs_main); BOOST_CHECK(pclaimTrie->nCurrentHeight == chainActive.Height() + 1); pclaimTrie->setExpirationTime(originalExpiration); // in case it was changed during the test + setNormalizationForkHeight(1000000); num_txs_for_next_block = 0; num_txs = 0; coinbase_txs_used = 0; @@ -157,7 +158,8 @@ struct ClaimTrieChainFixture{ void setNormalizationForkHeight(int targetMinusCurrent) { int target = chainActive.Height() + targetMinusCurrent; const Consensus::Params& consensus = Params().GetConsensus(); - normalization_original = consensus.nNormalizedNameForkHeight; + if (normalization_original < 0) + normalization_original = consensus.nNormalizedNameForkHeight; const_cast(consensus).nNormalizedNameForkHeight = target; }