Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/assets/assets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -753,8 +753,10 @@ bool CTransaction::VerifyNewUniqueAsset(std::string& strError) const
}

// check for (and count) new unique asset outpoints. make sure they share a root.
std::set<std::string> setUniqueAssets;
std::string assetRoot = "";
int assetOutpointCount = 0;

for (auto out : vout) {
if (IsScriptNewUniqueAsset(out.scriptPubKey)) {
CNewAsset asset;
Expand All @@ -770,6 +772,14 @@ bool CTransaction::VerifyNewUniqueAsset(std::string& strError) const
strError = "bad-txns-issue-unique-asset-compare-failed";
return false;
}

// Check for duplicate unique assets in the same transaction
if (setUniqueAssets.count(asset.strName)) {
strError = "bad-txns-issue-unique-duplicate-name-in-same-tx";
return false;
}

setUniqueAssets.insert(asset.strName);
assetOutpointCount += 1;
}
}
Expand Down