Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
251stream << b;252stream >> deserialized_b;253assert(b == deserialized_b && stream.empty());254}256{257const ServiceFlags service_flags = (ServiceFlags)u64;258(void)MayHaveUsefulAddressDB(service_flags);259}261{262DataStream stream{};264ser_writedata64(stream, u64);265const uint64_t deserialized_u64 = ser_readdata64(stream);266assert(u64 == deserialized_u64 && stream.empty());268ser_writedata32(stream, u32);269const uint32_t deserialized_u32 = ser_readdata32(stream);270assert(u32 == deserialized_u32 && stream.empty());272ser_writedata32be(stream, u32);273const uint32_t deserialized_u32be = ser_readdata32be(stream);274assert(u32 == deserialized_u32be && stream.empty());276ser_writedata16(stream, u16);277const uint16_t deserialized_u16 = ser_readdata16(stream);278assert(u16 == deserialized_u16 && stream.empty());280ser_writedata8(stream, u8);281const uint8_t deserialized_u8 = ser_readdata8(stream);282assert(u8 == deserialized_u8 && stream.empty());283}285{286DataStream stream{};288WriteCompactSize(stream, u64);289try {290const uint64_t deserialized_u64 = ReadCompactSize(stream);291assert(u64 == deserialized_u64 && stream.empty());292} catch (const std::ios_base::failure&) {293}294}295}
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.