Skip to content

Commit

Permalink
Merge pull request KomodoPlatform#520 from VerusCoin/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Asherda authored Jun 5, 2023
2 parents aaaf2ad + 9b96996 commit 26c211e
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/pbaas/pbaas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3884,6 +3884,13 @@ std::set<uint160> BaseBridgeCurrencies(const CCurrencyDefinition &systemDest, ui
if (!feeOnly || systemDest.launchSystemID == ASSETCHAINS_CHAINID)
{
retVal.insert(ASSETCHAINS_CHAINID);
for (auto &oneCur : systemDest.currencies)
{
if (!oneCur.IsNull())
{
retVal.insert(oneCur);
}
}
}
uint160 converterID = systemDest.launchSystemID == ASSETCHAINS_CHAINID ?
systemDest.GatewayConverterID() :
Expand Down Expand Up @@ -4304,6 +4311,14 @@ bool PrecheckReserveTransfer(const CTransaction &tx, int32_t outNum, CValidation
}
validExportCurrencies.insert(oneVEID);
}
if (importCurrencyDef.GetID() != systemDestID &&
systemDest.IsValid())
{
for (auto &oneVEID : systemDest.currencies)
{
validExportCurrencies.insert(oneVEID);
}
}
if (!validExportCurrencies.count(rt.FirstCurrency()))
{
return state.Error("Invalid currency preconversion in reserve transfer " + rt.ToUniValue().write(1,2));
Expand Down Expand Up @@ -4616,9 +4631,14 @@ bool PrecheckReserveTransfer(const CTransaction &tx, int32_t outNum, CValidation
}
else
{
if (systemDestID != ASSETCHAINS_CHAINID && !rt.IsPreConversion())
if (systemDestID != ASSETCHAINS_CHAINID)
{
validExportCurrencies = ValidExportCurrencies(systemDest, height);
if (rt.IsPreConversion() &&
!importCurrencyDef.GetCurrenciesMap().count(rt.FirstCurrency()))
{
return state.Error("Invalid currency export in reserve transfer " + rt.ToUniValue().write(1,2));
}
}

if ((validExportCurrencies.size() && !validExportCurrencies.count(rt.FirstCurrency())) ||
Expand Down

0 comments on commit 26c211e

Please sign in to comment.