mirror of https://github.com/bitcoin/bitcoin
Not only does this increase coverage, it is also more correct in that when ::LoadMempool is called with a mempool and chainstate, it calls AcceptToMemoryPool with just the chainstate. AcceptToMemoryPool will then act on the chainstate's mempool via CChainState::GetMempool, which may be different from the mempool originally passed to ::LoadMempool. (In this fuzz test's case, it definitely is different) Also, move DummyChainstate to its own file since it's now used by the validation_load_mempool fuzz test to replace CChainState's m_mempool.pull/25487/head
parent
b3267258b0
commit
b857ac60d9
@ -0,0 +1,19 @@
|
||||
// Copyright (c) 2022 The Bitcoin Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#ifndef BITCOIN_TEST_FUZZ_MEMPOOL_UTILS_H
|
||||
#define BITCOIN_TEST_FUZZ_MEMPOOL_UTILS_H
|
||||
|
||||
#include <validation.h>
|
||||
|
||||
class DummyChainState final : public CChainState
|
||||
{
|
||||
public:
|
||||
void SetMempool(CTxMemPool* mempool)
|
||||
{
|
||||
m_mempool = mempool;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // BITCOIN_TEST_FUZZ_MEMPOOL_UTILS_H
|
Loading…
Reference in new issue