16#include <boost/test/unit_test.hpp>
24 m_node.validation_signals->RegisterValidationInterface(&feeEst);
28 std::vector<CAmount> feeV;
32 for (
int j = 0; j < 10; j++) {
33 feeV.push_back(basefee * (j+1));
40 std::vector<Txid> txHashes[10];
44 for (
unsigned int i = 0; i < 128; i++)
48 tx.
vin[0].scriptSig = garbage;
50 tx.
vout[0].nValue=0LL;
54 std::vector<CTransactionRef> block;
60 while (blocknum < 200) {
61 for (
int j = 0; j < 10; j++) {
62 for (
int k = 0;
k < 4;
k++) {
63 tx.
vin[0].prevout.n = 10000*blocknum+100*j+
k;
80 txHashes[j].push_back(tx.
GetHash());
84 for (
int h = 0; h <= blocknum%10; h++) {
88 while (txHashes[9-h].size()) {
92 txHashes[9-h].pop_back();
105 m_node.validation_signals->SyncWithValidationInterfaceQueue();
116 m_node.validation_signals->SyncWithValidationInterfaceQueue();
118 std::vector<CAmount> origFeeEst;
125 for (
int i = 1; i < 10;i++) {
137 for (
int i = 10; i <= 48; i++) {
143 while (blocknum < 250) {
149 m_node.validation_signals->SyncWithValidationInterfaceQueue();
152 for (
int i = 2; i < 10;i++) {
160 while (blocknum < 265) {
161 for (
int j = 0; j < 10; j++) {
162 for (
int k = 0;
k < 4;
k++) {
163 tx.
vin[0].prevout.n = 10000*blocknum+100*j+
k;
180 txHashes[j].push_back(tx.
GetHash());
190 m_node.validation_signals->SyncWithValidationInterfaceQueue();
192 for (
int i = 1; i < 10;i++) {
198 for (
int j = 0; j < 10; j++) {
199 while(txHashes[j].size()) {
202 block.push_back(ptx);
203 txHashes[j].pop_back();
214 m_node.validation_signals->SyncWithValidationInterfaceQueue();
217 for (
int i = 2; i < 10;i++) {
223 while (blocknum < 665) {
224 for (
int j = 0; j < 10; j++) {
225 for (
int k = 0;
k < 4;
k++) {
226 tx.
vin[0].prevout.n = 10000*blocknum+100*j+
k;
245 block.push_back(ptx);
258 m_node.validation_signals->SyncWithValidationInterfaceQueue();
260 for (
int i = 2; i < 9; i++) {
int64_t CAmount
Amount in satoshis (Can be negative).
TryAddToMempool(pool, CTxMemPoolEntry(tx, fee, 0, 1, 0, false, 4, lp))
fs::path FeeestPath(const ArgsManager &argsman)
#define Assert(val)
Identity function.
The BlockPolicyEstimator is used for estimating the feerate needed for a transaction to be included i...
CFeeRate estimateFee(int confTarget) const EXCLUSIVE_LOCKS_REQUIRED(!m_cs_fee_estimator)
DEPRECATED.
Fee rate in satoshis per virtualbyte: CAmount / vB the feerate is represented internally as FeeFrac.
CAmount GetFeePerK() const
Return the fee in satoshis for a vsize of 1000 vbytes.
Serialized script, used inside transaction inputs and outputs.
CTransaction(const CMutableTransaction &tx)
Convert a CMutableTransaction into a CTransaction.
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
RecursiveMutex cs
This mutex needs to be locked when accessing mapTx or other members that are guarded by it.
CTransactionRef get(const Txid &hash) const
void removeForBlock(const std::vector< CTransactionRef > &vtx, unsigned int nBlockHeight) EXCLUSIVE_LOCKS_REQUIRED(cs)
uint64_t GetAndIncrementSequence() const EXCLUSIVE_LOCKS_REQUIRED(cs)
Guards this internal counter for external reporting.
void push_back(const T &value)
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
BOOST_FIXTURE_TEST_SUITE(cuckoocache_tests, BasicTestingSetup)
Test Suite for CuckooCache.
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(ipc_tests)
#define BOOST_CHECK(expr)
int64_t GetVirtualTransactionSize(int64_t nWeight, int64_t nSigOpCost, unsigned int bytes_per_sigop)
Compute the virtual transaction size (weight reinterpreted as bytes).
std::shared_ptr< const CTransaction > CTransactionRef
A mutable version of CTransaction.
std::vector< CTxOut > vout
Txid GetHash() const
Compute the hash of this CMutableTransaction.
Testing setup that performs all steps up until right before ChainstateManager gets initialized.
NewMempoolTransactionInfo(const CTransactionRef &tx, const CAmount &fee, const int64_t vsize, const unsigned int height, const bool mempool_limit_bypassed, const bool submitted_in_package, const bool chainstate_is_current, const bool has_no_mempool_parents)
TestMemPoolEntryHelper & Time(NodeSeconds tp)
CTxMemPoolEntry FromTx(const CMutableTransaction &tx) const
TestMemPoolEntryHelper & Height(unsigned int _height)
TestMemPoolEntryHelper & Fee(CAmount _fee)
T Now()
Return the current time point cast to the given precision.