From e07e355e017d6eebd0e83c4ccecad4a163c55f57 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Mon, 28 Mar 2022 15:26:13 -0600 Subject: [PATCH] Fix overzealous matching of Orchard FVKs to addresses. It is possible for an address to be generated for a UFVK that contains an Orchard FVK, but where the address does not contain an Orchard receiver. Cache restoration was failing on startup because we failed to allow for this case. --- src/wallet/wallet.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index e582503de..f80b22909 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1100,13 +1100,7 @@ bool CWallet::LoadCaches() auto orchardFvk = ufvk.value().GetOrchardKey(); auto orchardReceiver = addr.first.GetOrchardReceiver(); - if (orchardFvk.has_value() != orchardReceiver.has_value()) { - LogPrintf("%s: Error: Orchard receiver in unified address is inconsistent with the unified viewing key.\n", - __func__); - return false; - } - - if (orchardFvk.has_value()) { + if (orchardFvk.has_value() && orchardReceiver.has_value()) { if (!AddOrchardRawAddress(orchardFvk.value().ToIncomingViewingKey(), orchardReceiver.value())) { LogPrintf("%s: Error: Unable to add Orchard address -> IVK mapping.\n", __func__);