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.
1#!/usr/bin/env bpftrace3BEGIN4{5printf("Logging P2P traffic\n")6}8usdt:./build/bin/bitcoind:net:inbound_message9{10$peer_id = (int64) arg0;11$peer_addr = str(arg1);12$peer_type = str(arg2);13$msg_type = str(arg3);14$msg_len = arg4;15printf("inbound '%s' msg from peer %d (%s, %s) with %d bytes\n", $msg_type, $peer_id, $peer_type, $peer_addr, $msg_len);16}18usdt:./build/bin/bitcoind:net:outbound_message19{20$peer_id = (int64) arg0;21$peer_addr = str(arg1);22$peer_type = str(arg2);23$msg_type = str(arg3);24$msg_len = arg4;26printf("outbound '%s' msg to peer %d (%s, %s) with %d bytes\n", $msg_type, $peer_id, $peer_type, $peer_addr, $msg_len);27}
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.