From 659c4be60f1dea4595f8bb8962e0dedddf4be787 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Fri, 26 Jun 2020 12:47:48 +0400 Subject: [PATCH] =?UTF-8?q?mempool:=20make=20it=20clear=20overwriting=20of?= =?UTF-8?q?=20pre/postCheck=20filters=20is=20intent=E2=80=A6=20(#5054)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …ional Closes #4773 --- mempool/clist_mempool.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mempool/clist_mempool.go b/mempool/clist_mempool.go index aa173d07c..abc696909 100644 --- a/mempool/clist_mempool.go +++ b/mempool/clist_mempool.go @@ -112,13 +112,15 @@ func (mem *CListMempool) SetLogger(l log.Logger) { } // WithPreCheck sets a filter for the mempool to reject a tx if f(tx) returns -// false. This is ran before CheckTx. +// false. This is ran before CheckTx. Only applies to the first created block. +// After that, Update overwrites the existing value. func WithPreCheck(f PreCheckFunc) CListMempoolOption { return func(mem *CListMempool) { mem.preCheck = f } } // WithPostCheck sets a filter for the mempool to reject a tx if f(tx) returns -// false. This is ran after CheckTx. +// false. This is ran after CheckTx. Only applies to the first created block. +// After that, Update overwrites the existing value. func WithPostCheck(f PostCheckFunc) CListMempoolOption { return func(mem *CListMempool) { mem.postCheck = f } }