aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2016-04-14 17:54:40 +0200
committerWladimir J. van der Laan <[email protected]>2016-04-14 17:54:42 +0200
commite6a4d48a9bff0bdbcca3a13de59b5e6e683a6aac (patch)
tree47bf73cbc4270a1f5433de6e187116ff4668ead9 /src/main.cpp
parentMerge #7853: [qa] py2: Unfiddle strings into bytes explicitly (diff)
parentAvoid unnecessary database access for unknown transactions (diff)
downloaddiscoin-e6a4d48a9bff0bdbcca3a13de59b5e6e683a6aac.tar.xz
discoin-e6a4d48a9bff0bdbcca3a13de59b5e6e683a6aac.zip
Merge #7874: Improve AlreadyHave
c6cb6f7 Avoid unnecessary database access for unknown transactions (Alex Morcos)
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index fff1cc346..63516adae 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -4344,10 +4344,12 @@ bool static AlreadyHave(const CInv& inv) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
recentRejects->reset();
}
+ // Use pcoinsTip->HaveCoinsInCache as a quick approximation to exclude
+ // requesting or processing some txs which have already been included in a block
return recentRejects->contains(inv.hash) ||
mempool.exists(inv.hash) ||
mapOrphanTransactions.count(inv.hash) ||
- pcoinsTip->HaveCoins(inv.hash);
+ pcoinsTip->HaveCoinsInCache(inv.hash);
}
case MSG_BLOCK:
return mapBlockIndex.count(inv.hash);