383a3b8b02
- Replace ~290 BOOST_FOREACH with C++11 range-for across 41+ files - Replace boost::assign::map_list_of with C++11 brace initialization - Remove PAIRTYPE macro (no longer needed without BOOST_FOREACH) - Guard OpenSSL locking callbacks for 3.x (no-ops in >= 1.1.0) - Fix Qt deprecated APIs for Qt6 compat (QStyleOptionViewItemV4, setResizeMode) - Add openssl_compat.h version string wrapper - Enable C++17 in makefile.unix and triangles-qt.pro - Delete 163 dead Tor v2 source files (~150K lines removed) - Add embedded Tor scaffold (tor_embedded.h/cpp) using tor_api.h - Add build-libtor.sh helper and CODEX-TOR-GUIDE.md - Update makefile.unix and .pro with USE_TOR_EMBEDDED optional flag - Fallback to external tor_process when not compiled with libtor - IBD pipeline refill: 100 -> 1000 blocks - Send/recv buffer limits: unlimited -> 100MB/32MB - Orphan block cap: unlimited -> 750 with random eviction - Socket poll: 10ms -> 1ms during IBD - Message handler sleep: 10ms -> 1ms during IBD - Stall detection timeout: 5s -> 2s Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
33 lines
994 B
C++
33 lines
994 B
C++
//
|
|
// Unit tests for block-chain checkpoints
|
|
//
|
|
#include <boost/test/unit_test.hpp>
|
|
|
|
#include "../checkpoints.h"
|
|
#include "../util.h"
|
|
|
|
using namespace std;
|
|
|
|
BOOST_AUTO_TEST_SUITE(Checkpoints_tests)
|
|
|
|
BOOST_AUTO_TEST_CASE(sanity)
|
|
{
|
|
uint256 p11111 = uint256("0x05cbc42d0421207a39427f1b44610a30380e0e3dd593c154276d7c8d4ae8c9b2");
|
|
uint256 p16666 = uint256("0x682d99d096441e046dae8dd86d5bdfaa32d4e29dea6cf38273bb2b261905f1e2");
|
|
BOOST_CHECK(Checkpoints::CheckBlock(11111, p11111));
|
|
BOOST_CHECK(Checkpoints::CheckBlock(16666, p16666));
|
|
|
|
|
|
// Wrong hashes at checkpoints should fail:
|
|
BOOST_CHECK(!Checkpoints::CheckBlock(11111, p16666));
|
|
BOOST_CHECK(!Checkpoints::CheckBlock(16666, p11111));
|
|
|
|
// ... but any hash not at a checkpoint should succeed:
|
|
BOOST_CHECK(Checkpoints::CheckBlock(11111+1, p16666));
|
|
BOOST_CHECK(Checkpoints::CheckBlock(16666+1, p11111));
|
|
|
|
BOOST_CHECK(Checkpoints::GetTotalBlocksEstimate() >= 16666);
|
|
}
|
|
|
|
BOOST_AUTO_TEST_SUITE_END()
|