11#include <boost/test/unit_test.hpp>
13#define SKIPLIST_LENGTH 300000
36 for (
int i=0; i < 1000; i++) {
38 int to = m_rng.randrange(from + 1);
79 for (
int n=0; n<100; n++) {
80 int r = m_rng.randrange(150000);
89 for (
unsigned int i = 1; i < 12 && i < locator.
vHave.size() - 1; i++) {
94 unsigned int dist = 2;
95 for (
unsigned int i = 12; i < locator.
vHave.size() - 1; i++) {
106 for (
unsigned int i=0; i<
vBlocksMain.size(); i++) {
125 for (
unsigned int i=0; i<
vBlocksMain.size(); ++i) {
135 for (
unsigned int i=0; i<10000; ++i) {
148 std::list<CBlockIndex>
blocks;
149 for (
const unsigned int timeMax : {100, 100, 100, 200, 200, 200, 300, 300, 300}) {
154 blocks.back().BuildSkip();
arith_uint256 UintToArith256(const uint256 &a)
uint256 ArithToUint256(const arith_uint256 &a)
CBlockLocator GetLocator(const CBlockIndex *index)
Get a locator for a block index entry.
The block chain is a tree shaped structure starting with the genesis block at the root,...
int nHeight
height of the entry in the chain. The genesis block has height 0
An in-memory indexed chain of blocks.
void SetTip(CBlockIndex &block)
Set/initialize a chain with a given tip.
CBlockIndex * FindEarliestAtLeast(int64_t nTime, int height) const
Find the earliest block with timestamp equal or greater than the given time and height equal or great...
256-bit unsigned big integer.
uint64_t GetLow64() const
BOOST_FIXTURE_TEST_SUITE(cuckoocache_tests, BasicTestingSetup)
Test Suite for CuckooCache.
BOOST_AUTO_TEST_SUITE_END()
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)
BOOST_AUTO_TEST_CASE(skiplist_test)
Describes a place in the block chain to another node such that if the other node doesn't have the sam...
std::vector< uint256 > vHave
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.