| 91 | BOOST_FIXTURE_TEST_SUITE(process_xthinblock_tests, XThinBlockSetup); |
| 92 | |
| 93 | BOOST_AUTO_TEST_CASE(xthinblock_ignore_invalid) { |
| 94 | XThinBlock xblock(TestBlock1(), CBloomFilter());; |
| 95 | xblock.txHashes.clear(); // <- makes block invalid |
| 96 | |
| 97 | DummyWorker<XThinWorker> worker(tmgr, 42); |
| 98 | worker.addWork(xblock.header.GetHash()); |
| 99 | CDataStream s = stream(xblock); |
| 100 | DummyXThinProcessor process(pfrom, worker, headerprocessor); |
| 101 | process(s, NullFinder(), MAX_BLOCK_SIZE, 1); |
| 102 | |
| 103 | // Should reset the worker. |
| 104 | BOOST_CHECK(!worker.isWorking()); |
| 105 | |
| 106 | // ...and misbehave the client. |
| 107 | BOOST_CHECK_EQUAL(20, process.misbehaved); |
| 108 | BOOST_CHECK(!worker.buildStubCalled); |
| 109 | BOOST_CHECK_EQUAL("reject", pfrom.messages.at(0)); |
| 110 | } |
| 111 | |
| 112 | BOOST_AUTO_TEST_CASE(xthinblock_ignore_if_has_block_data) { |
| 113 | // Add block to mapBlockIndex (so we already have it) |
nothing calls this directly
no test coverage detected