Skip to content

Commit abcba59

Browse files
fix: use try_emplace
1 parent d5dbbdb commit abcba59

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/llmq/instantsend.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -1193,9 +1193,7 @@ void CInstantSendManager::AddNonLockedTx(const CTransactionRef& tx, const CBlock
11931193
if (ShouldReportISLockTiming()) {
11941194
LOCK(cs_timingsTxSeen);
11951195
// Only insert the time the first time we see the tx, as we sometimes try to resign
1196-
if (auto it = timingsTxSeen.find(tx->GetHash()); it == timingsTxSeen.end()) {
1197-
timingsTxSeen[tx->GetHash()] = GetTimeMillis();
1198-
}
1196+
timingsTxSeen.try_emplace(tx->GetHash(), GetTimeMillis());
11991197
}
12001198

12011199
LogPrint(BCLog::INSTANTSEND, "CInstantSendManager::%s -- txid=%s, pindexMined=%s\n", __func__,

0 commit comments

Comments
 (0)