Changeset View
Changeset View
Standalone View
Standalone View
src/test/miner_tests.cpp
// Copyright (c) 2011-2016 The Bitcoin Core developers | // Copyright (c) 2011-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include "miner.h" | |||||
#include "chainparams.h" | #include "chainparams.h" | ||||
#include "coins.h" | #include "coins.h" | ||||
#include "config.h" | #include "config.h" | ||||
#include "consensus/consensus.h" | #include "consensus/consensus.h" | ||||
#include "consensus/merkle.h" | #include "consensus/merkle.h" | ||||
#include "consensus/validation.h" | #include "consensus/validation.h" | ||||
#include "miner.h" | |||||
#include "policy/policy.h" | #include "policy/policy.h" | ||||
#include "pubkey.h" | #include "pubkey.h" | ||||
#include "script/standard.h" | #include "script/standard.h" | ||||
#include "txmempool.h" | #include "txmempool.h" | ||||
#include "uint256.h" | #include "uint256.h" | ||||
#include "util.h" | #include "util.h" | ||||
#include "utilstrencodings.h" | #include "utilstrencodings.h" | ||||
#include "validation.h" | #include "validation.h" | ||||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | void TestPackageSelection(const CChainParams &chainparams, CScript scriptPubKey, | ||||
// Test the ancestor feerate transaction selection. | // Test the ancestor feerate transaction selection. | ||||
TestMemPoolEntryHelper entry; | TestMemPoolEntryHelper entry; | ||||
GlobalConfig config; | GlobalConfig config; | ||||
// these 3 tests assume blockprioritypercentage is 0. | // these 3 tests assume blockprioritypercentage is 0. | ||||
config.SetBlockPriorityPercentage(0); | config.SetBlockPriorityPercentage(0); | ||||
// the following tests assume that minimum fee rate is 1000 satoshi per kB. | |||||
ForceSetArg("-blockmintxfee", std::to_string(1000)); | |||||
blockMinFeeRate = CFeeRate(1000); | |||||
// Test that a medium fee transaction will be selected after a higher fee | // Test that a medium fee transaction will be selected after a higher fee | ||||
// rate package with a low fee rate parent. | // rate package with a low fee rate parent. | ||||
CMutableTransaction tx; | CMutableTransaction tx; | ||||
tx.vin.resize(1); | tx.vin.resize(1); | ||||
tx.vin[0].scriptSig = CScript() << OP_1; | tx.vin[0].scriptSig = CScript() << OP_1; | ||||
tx.vin[0].prevout.hash = txFirst[0]->GetId(); | tx.vin[0].prevout.hash = txFirst[0]->GetId(); | ||||
tx.vin[0].prevout.n = 0; | tx.vin[0].prevout.n = 0; | ||||
tx.vout.resize(1); | tx.vout.resize(1); | ||||
▲ Show 20 Lines • Show All 686 Lines • Show Last 20 Lines |