diff --git a/src/blind.cpp b/src/blind.cpp index 6de63eac56..eec35f8c07 100644 --- a/src/blind.cpp +++ b/src/blind.cpp @@ -49,7 +49,7 @@ bool UnblindOutput(const CKey &key, const CTxOut& txout, CAmount& amount_out, ui size_t msg_size = 64; uint64_t min_value, max_value, amount; secp256k1_pedersen_commitment commit; - if (!txout.nAsset.IsAssetCommitment() || txout.nValue.IsAmount()) + if (!txout.nAsset.IsCommitment() || txout.nValue.IsAmount()) return false; secp256k1_generator gen; @@ -126,7 +126,7 @@ int BlindOutputs(std::vector& input_blinding_factors, const std::vecto // Wallet only understands all-blinded or all-unblinded assert((output_blinding_factors[nOut] != uint256()) == !out.nValue.IsAmount()); assert(out.nValue.IsAmount() == out.nAsset.IsAsset()); - assert(out.nAsset.IsAssetCommitment() == !out.nAsset.vchSurjectionproof.empty()); + assert(out.nAsset.IsCommitment() == !out.nAsset.vchSurjectionproof.empty()); if (output_blinding_factors[nOut] != uint256()) { assert(output_asset_blinding_factors[nOut] != uint256()); blindptrs.push_back(output_blinding_factors[nOut].begin()); diff --git a/src/primitives/transaction.cpp b/src/primitives/transaction.cpp index 4e6159605f..77d9549365 100644 --- a/src/primitives/transaction.cpp +++ b/src/primitives/transaction.cpp @@ -75,7 +75,7 @@ std::string CTxOut::ToString() const std::string strAsset; if (nAsset.IsAsset()) strAsset = strprintf("nAsset=%s, ", nAsset.GetAsset().GetHex()); - if (nAsset.IsAssetCommitment()) + if (nAsset.IsCommitment()) strAsset = std::string("nAsset=UNKNOWN, "); return strprintf("CTxOut(%snValue=%s, scriptPubKey=%s)", strAsset, (nValue.IsAmount() ? strprintf("%d.%08d", nValue.GetAmount() / COIN, nValue.GetAmount() % COIN) : std::string("UNKNOWN")), HexStr(scriptPubKey).substr(0, 30)); } diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h index aad9c8dac2..450c5d55f1 100644 --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -84,7 +84,7 @@ public: return *reinterpret_cast(&vchAssetTag[1]); } - bool IsAssetCommitment() const + bool IsCommitment() const { return vchAssetTag.size()==nAssetTagSize && (vchAssetTag[0]==10 || vchAssetTag[0]==11); } diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 7791eec8cf..7f2cc2e88a 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -147,7 +147,7 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry) if (asset.IsAsset()) { out.push_back(Pair("asset", asset.GetAsset().GetHex())); } - else if (asset.IsAssetCommitment()) { + else if (asset.IsCommitment()) { out.push_back(Pair("assettag", HexStr(asset.vchAssetTag))); } diff --git a/src/validation.cpp b/src/validation.cpp index 8419edb283..7181666900 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -687,7 +687,7 @@ bool VerifyAmounts(const CCoinsViewCache& cache, const CTransaction& tx, std::ve ret = secp256k1_generator_generate(secp256k1_ctx_verify_amounts, &gen, asset.GetAsset().begin()); assert(ret != 0); } - else if (asset.IsAssetCommitment()) { + else if (asset.IsCommitment()) { if (secp256k1_generator_parse(secp256k1_ctx_verify_amounts, &gen, &asset.vchAssetTag[0]) != 1) return false; } @@ -730,7 +730,7 @@ bool VerifyAmounts(const CCoinsViewCache& cache, const CTransaction& tx, std::ve ret = secp256k1_generator_generate(secp256k1_ctx_verify_amounts, &gen, asset.GetAsset().begin()); assert(ret != 0); } - else if (asset.IsAssetCommitment()) { + else if (asset.IsCommitment()) { if (secp256k1_generator_parse(secp256k1_ctx_verify_amounts, &gen, &asset.vchAssetTag[0]) != 1) return false; }