From: miketout Date: Sat, 1 May 2021 21:21:29 +0000 (-0700) Subject: Notarization fix X-Git-Url: https://repo.jachan.dev/VerusCoin.git/commitdiff_plain/42d4737134185552397ff1ff7d40a6dd6264425d Notarization fix --- diff --git a/src/pbaas/notarization.cpp b/src/pbaas/notarization.cpp index 6be9ecba8..f9e6921f8 100644 --- a/src/pbaas/notarization.cpp +++ b/src/pbaas/notarization.cpp @@ -1235,9 +1235,9 @@ bool CPBaaSNotarization::CreateEarnedNotarization(const CRPCChainData &externalS // get the latest notarization information for the new, earned notarization // one system may provide one proof root and multiple currency states CProofRoot latestProofRoot = CProofRoot(find_value(result, "latestproofroot")); - if (!latestProofRoot.IsValid()) + if (!latestProofRoot.IsValid() || notarization.proofRoots[latestProofRoot.systemID].rootHeight >= latestProofRoot.rootHeight) { - return state.Error("no-latest-proof-root"); + return state.Error("no-new-latest-proof-root"); } notarization.proofRoots[latestProofRoot.systemID] = latestProofRoot; notarization.notarizationHeight = latestProofRoot.rootHeight; diff --git a/src/pbaas/reserves.cpp b/src/pbaas/reserves.cpp index 4f15e5dea..ad82c324c 100644 --- a/src/pbaas/reserves.cpp +++ b/src/pbaas/reserves.cpp @@ -2145,7 +2145,7 @@ bool CReserveTransactionDescriptor::AddReserveTransferImportOutputs(const CCurre 0, systemDestID, 0, - systemDestID, + importCurrencyID, CTransferDestination()); } else if (importCurrencyState.IsRefunding() || (exportObjects[i].IsPreConversion() && importCurrencyState.IsLaunchCompleteMarker())) @@ -2158,9 +2158,9 @@ bool CReserveTransactionDescriptor::AddReserveTransferImportOutputs(const CCurre } if (((importCurrencyID != curTransfer.FirstCurrency()) && (curTransfer.flags & curTransfer.IMPORT_TO_SOURCE)) || - ((importCurrencyID == curTransfer.FirstCurrency()) && !((curTransfer.flags & curTransfer.IMPORT_TO_SOURCE)))) + ((importCurrencyID != curTransfer.destCurrencyID) && !((curTransfer.flags & curTransfer.IMPORT_TO_SOURCE)))) { - printf("%s: Importing to source currency without flag or importing to destination with source flag\n", __func__); + printf("%s: Importing to source currency w/o flag or importing to destination w/source flag:\n%s\n", __func__, curTransfer.ToUniValue().write(1,2).c_str()); LogPrintf("%s: Importing to source currency without flag or importing to destination with source flag\n", __func__); return false; }