Skip to content

Commit 92abe9b

Browse files
Merge #6964: perf: remove duplicated check of same key in the instant send database
42b3341 perf: remove duplicated check of same key in the instant send database (Konstantin Akimov) Pull request description: ## Issue being fixed or feature implemented 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. ## What was done? This PR removes duplicated check ## How Has This Been Tested? See CI ## Breaking Changes N/A ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone ACKs for top commit: PastaPastaPasta: utACK [42b3341](42b3341) kwvg: utACK 42b3341 UdjinM6: utACK 42b3341 Tree-SHA512: f0213e7ad8f4d380561538d194a9fc9ed1b1ed4580f1848aa14d7958b817ac716e09bb4b83f611a86b2f1b8d920fb65f87721b35bee8f7e84b97193eae459adb
1 parent 5a1ec4c commit 92abe9b

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
@@ -280,11 +280,7 @@ InstantSendLockPtr CInstantSendDb::GetInstantSendLockByHashInternal(const uint25
280280
ret = std::make_shared<InstantSendLock>();
281281
bool exists = db->Read(std::make_tuple(DB_ISLOCK_BY_HASH, hash), *ret);
282282
if (!exists || (::SerializeHash(*ret) != hash)) {
283-
ret = std::make_shared<InstantSendLock>();
284-
exists = db->Read(std::make_tuple(DB_ISLOCK_BY_HASH, hash), *ret);
285-
if (!exists || (::SerializeHash(*ret) != hash)) {
286-
ret = nullptr;
287-
}
283+
ret = nullptr;
288284
}
289285
islockCache.insert(hash, ret);
290286
return ret;

0 commit comments

Comments
 (0)