Skip to content

Commit 42b3341

Browse files
committed
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
1 parent 368eebb commit 42b3341

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/instantsend/db.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,7 @@ InstantSendLockPtr CInstantSendDb::GetInstantSendLockByHashInternal(const uint25
279279
ret = std::make_shared<InstantSendLock>();
280280
bool exists = db->Read(std::make_tuple(DB_ISLOCK_BY_HASH, hash), *ret);
281281
if (!exists || (::SerializeHash(*ret) != hash)) {
282-
ret = std::make_shared<InstantSendLock>();
283-
exists = db->Read(std::make_tuple(DB_ISLOCK_BY_HASH, hash), *ret);
284-
if (!exists || (::SerializeHash(*ret) != hash)) {
285-
ret = nullptr;
286-
}
282+
ret = nullptr;
287283
}
288284
islockCache.insert(hash, ret);
289285
return ret;

0 commit comments

Comments
 (0)