diff options
author | Suhas Daftuar <sdaftuar@gmail.com> | 2020-01-17 11:43:11 -0500 |
---|---|---|
committer | Suhas Daftuar <sdaftuar@gmail.com> | 2020-01-29 09:37:21 -0500 |
commit | a029e18c2bf67dd00552b0f4bbc85fa2fa5b973b (patch) | |
tree | 813c7746c6795e0bae89ca162ebaac6fca80a6be /src/leveldb/table | |
parent | 0deba680646fc5c2bd4ead59933605970ae80995 (diff) |
Use rolling bloom filter of recent block tx's for AlreadyHave() check
In order to determine whether to download or process a relayed transaction, we
try to determine if we already have the transaction, either in the mempool, in
our recently rejected filter, in our orphan pool, or already confirmed in the
chain itself.
Prior to this commit, the heuristic for checking the chain is based on whether
there's an output corresponding to the 0- or 1-index vout in our coin cache.
While that is a quick check, it is very imprecise (say if those outputs were
already spent in a block) -- we can do better by just keeping a rolling bloom
filter of the transactions in recent blocks, which will capture the case of a
transaction which has been confirmed and then fully spent already.
To avoid relay problems for transactions which have been included in a recent
block but then reorged out of the chain, we clear the bloom filter whenever a
block is disconnected.
Diffstat (limited to 'src/leveldb/table')
0 files changed, 0 insertions, 0 deletions