From 42b334152844637ad677593f130c86266bf94d4a Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Wed, 12 Nov 2025 02:15:05 +0700 Subject: [PATCH] perf: remove duplicated check of same key in the instant send database Previous implementation checked both Deterministic and Non-deterministic instant send locks; though once non-determinstic has been removed, implementation has been updated and now the same key is checked twice. This commit removes duplicated check --- src/instantsend/db.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/instantsend/db.cpp b/src/instantsend/db.cpp index 778596851385..49af9762c010 100644 --- a/src/instantsend/db.cpp +++ b/src/instantsend/db.cpp @@ -279,11 +279,7 @@ InstantSendLockPtr CInstantSendDb::GetInstantSendLockByHashInternal(const uint25 ret = std::make_shared(); bool exists = db->Read(std::make_tuple(DB_ISLOCK_BY_HASH, hash), *ret); if (!exists || (::SerializeHash(*ret) != hash)) { - ret = std::make_shared(); - exists = db->Read(std::make_tuple(DB_ISLOCK_BY_HASH, hash), *ret); - if (!exists || (::SerializeHash(*ret) != hash)) { - ret = nullptr; - } + ret = nullptr; } islockCache.insert(hash, ret); return ret;