15 #include <boost/test/unit_test.hpp>
35 std::vector<CMutableTransaction> spends;
37 for (
int i = 0; i < 2; i++)
39 spends[i].nVersion = 1;
40 spends[i].vin.resize(1);
41 spends[i].vin[0].prevout.hash = coinbaseTxns[0].GetHash();
42 spends[i].vin[0].prevout.n = 0;
43 spends[i].vout.resize(1);
44 spends[i].vout[0].nValue = 11*CENT;
45 spends[i].vout[0].scriptPubKey = scriptPubKey;
48 std::vector<unsigned char> vchSig;
52 spends[i].vin[0].scriptSig << vchSig;
59 block = CreateAndProcessBlock(spends, scriptPubKey);
65 block = CreateAndProcessBlock(spends, scriptPubKey);
73 block = CreateAndProcessBlock(spends, scriptPubKey);
79 std::vector<CMutableTransaction> oneSpend;
80 oneSpend.push_back(spends[0]);
82 block = CreateAndProcessBlock(oneSpend, scriptPubKey);
uint256 GetBlockHash() const
CBlockIndex * Tip(bool fProofOfStake=false) const
Returns the index entry for the tip of this chain, or nullptr if none.
Serialized script, used inside transaction inputs and outputs.
unsigned long size() const
Capture information about block/transaction validation.
BOOST_AUTO_TEST_SUITE(cuckoocache_tests)
Test Suite for CuckooCache.
BOOST_AUTO_TEST_SUITE_END()
uint256 SignatureHash(const CScript &scriptCode, const CTransaction &txTo, unsigned int nIn, int nHashType, const CAmount &amount, SigVersion sigversion, const PrecomputedTransactionData *cache)
RecursiveMutex cs_main
Global state.
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)
std::vector< unsigned char > ToByteVector(const T &in)
A mutable version of CTransaction.
BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup)
void SetMockTime(int64_t nMockTimeIn)
For testing.
int64_t GetTime()
DEPRECATED Use either GetSystemTimeInSeconds (not mockable) or GetTime<T> (mockable)
CTxMemPool mempool(::minRelayTxFee)
bool AcceptToMemoryPool(CTxMemPool &pool, CValidationState &state, const CTransactionRef &tx, bool fLimitFree, bool *pfMissingInputs, bool fOverrideMempoolLimit, bool fRejectInsaneFee, bool ignoreFees)
(try to) add transaction to memory pool
CChain chainActive
The currently-connected chain of blocks (protected by cs_main).