From 4f6baeab6d6db4121d86de59c976bf57a527daf0 Mon Sep 17 00:00:00 2001 From: miketout Date: Sun, 28 May 2023 16:58:17 -0700 Subject: [PATCH 1/3] Debug output for chips10sec reorg sync --- src/pbaas/notarization.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pbaas/notarization.cpp b/src/pbaas/notarization.cpp index 986e0cb5ce9..d09ed72c2de 100644 --- a/src/pbaas/notarization.cpp +++ b/src/pbaas/notarization.cpp @@ -5368,7 +5368,7 @@ bool CPBaaSNotarization::CheckCrossNotarizationProgression(const CCurrencyDefini // ensure that we can always find one after the first and that we have not moved backwards in the one we find // any cross confirmed notarization also must have first been confirmed on this chain, so verify that as well - if (foundPriorLocalCrossConfirmed && + if (foundPriorLocalCrossConfirmed && (!foundLocalCrossConfirmed || lastConfirmedAddressIndexKey.first.blockHeight < priorLastConfirmedAddressIndexKey.first.blockHeight)) { @@ -9303,7 +9303,7 @@ bool PreCheckAcceptedOrEarnedNotarization(const CTransaction &tx, int32_t outNum bool posNewFormat = (!PBAAS_TESTMODE || chainActive[lastConfirmedAddressIndexKey.first.blockHeight]->nTime >= PBAAS_TESTFORK2_TIME); - if (foundPriorLocalCrossConfirmed && + if (foundPriorLocalCrossConfirmed && (!foundLocalCrossConfirmed || (posNewFormat && lastConfirmedAddressIndexKey.first.blockHeight < priorLastConfirmedAddressIndexKey.first.blockHeight))) @@ -10526,6 +10526,7 @@ bool PreCheckFinalizeNotarization(const CTransaction &tx, int32_t outNum, CValid { continue; } + LogPrint("notarization", "%s: notarization finalization tip transaction not in prior chain at height %u\n", __func__, height); if (confirmNeedsEvidence && (!PBAAS_TESTMODE || chainActive[height - 1]->nTime >= PBAAS_TESTFORK3_TIME)) { return state.Error("Invalid confirmation evidence 1"); From 0b85b074a63b24db7d0cfc9b2cf46b1f6be24d05 Mon Sep 17 00:00:00 2001 From: miketout Date: Sun, 28 May 2023 17:35:43 -0700 Subject: [PATCH 2/3] Refuse offer to buy ID with explanation --- src/rpc/pbaasrpc.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rpc/pbaasrpc.cpp b/src/rpc/pbaasrpc.cpp index b6a5db873fc..85c791ccfd5 100644 --- a/src/rpc/pbaasrpc.cpp +++ b/src/rpc/pbaasrpc.cpp @@ -7097,6 +7097,11 @@ UniValue takeoffer(const UniValue& params, bool fHelp) throw JSONRPCError(RPC_INVALID_PARAMETER, "identity, " + acceptedIdentity.GetID().GetHex() + ", not found "); } + if (oldID.HasTokenizedControl()) + { + throw JSONRPCError(RPC_INVALID_PARAMETER, "Do not buy an ID with tokenized ID control via the marketplace. Buy the token for a revoked ID with all authorities instead. ID: " + acceptedIdentity.GetID().GetHex()); + } + oldID.revocationAuthority = oldID.GetID(); oldID.recoveryAuthority = oldID.GetID(); oldID.privateAddresses.clear(); From b8d5e85a9130ff38941899818bd1193f57488a73 Mon Sep 17 00:00:00 2001 From: miketout Date: Sun, 28 May 2023 17:39:15 -0700 Subject: [PATCH 3/3] Improved message --- src/rpc/pbaasrpc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpc/pbaasrpc.cpp b/src/rpc/pbaasrpc.cpp index 85c791ccfd5..7d9cf187368 100644 --- a/src/rpc/pbaasrpc.cpp +++ b/src/rpc/pbaasrpc.cpp @@ -7099,7 +7099,7 @@ UniValue takeoffer(const UniValue& params, bool fHelp) if (oldID.HasTokenizedControl()) { - throw JSONRPCError(RPC_INVALID_PARAMETER, "Do not buy an ID with tokenized ID control via the marketplace. Buy the token for a revoked ID with all authorities instead. ID: " + acceptedIdentity.GetID().GetHex()); + throw JSONRPCError(RPC_INVALID_PARAMETER, "Do not buy an ID with tokenized ID control via the marketplace. Buy the token that is the ID control (or NFT) for a revoked ID with all authorities instead. ID: " + acceptedIdentity.GetID().GetHex()); } oldID.revocationAuthority = oldID.GetID();