Inside Bitcoin
Opening the selected file…
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 python32# Copyright (c) The Bitcoin Core developers3# Distributed under the MIT software license, see the accompanying4# file COPYING or https://opensource.org/license/mit/.6import os7import shlex8from pathlib import Path11def main():12base_root = Path(os.environ["BASE_ROOT_DIR"])13base_out = Path(os.environ["BASE_OUTDIR"])14suppressions_file = base_root / "test" / "sanitizer_suppressions" / "valgrind.supp"15target_names = {b.name for b in (base_out / "bin").iterdir()}17for exe in base_root.rglob("*"):18if exe.name in target_names and exe.is_file() and os.access(exe, os.X_OK):19print(f"Wrap {exe} ...")20original_path = exe.with_name(f"{exe.name}_orig")21exe.rename(original_path)22exe.write_text(23"#!/usr/bin/env bash\n"24"exec valgrind --gen-suppressions=all --quiet --error-exitcode=1 "25f"--suppressions={shlex.quote(str(suppressions_file))} "26f'{shlex.quote(str(original_path))} "$@"\n'27)28exe.chmod(exe.stat().st_mode | 0o111)31if __name__ == "__main__":32main()
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.