rpc: [wallet] Use unsigned type for tx version in sendall #34135

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2512-rpc-wallet-less-i32 changing 1 files +1 −1
  1. maflcko commented at 10:10 am on December 22, 2025: member

    It is confusing to parse the unsigned tx version as a signed type. Also, it makes it harder to use the integer sanitizer.

    Can be tested via:

    • Build with the flags -DCMAKE_C_COMPILER='clang' -DCMAKE_CXX_COMPILER='clang++' -DSANITIZERS=undefined,integer,float-divide-by-zero
    • Set the existing suppressions: export UBSAN_OPTIONS="suppressions=$(pwd)/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=0:report_error_type=1"
    • Start the RPC server, e.g. ./bld-cmake/bin/bitcoin-qt -datadir=/tmp -regtest -server
    • Call the sendall RPC, e.g. ./bld-cmake/bin/bitcoin-cli -datadir=/tmp -regtest -named sendall '["bcrt1qlrt3xps4wxpfcjmljrayr2ualczmnfvd4vzdq3"]' fee_rate=1.234 version=-1

    Before:

    0src/wallet/rpc/spend.cpp:1470:42: runtime error: implicit conversion from type 'int' of value -1 (32-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned)
    1
    2Invalid parameter, version out of range(1~3)
    

    After:

    0JSON integer out of range
    
  2. rpc: [wallet] Use unsigned type for tx version in sendall fafbc70d48
  3. DrahtBot added the label RPC/REST/ZMQ on Dec 22, 2025
  4. DrahtBot commented at 10:11 am on December 22, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34135.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

  5. maflcko added the label Wallet on Dec 22, 2025

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-12-23 00:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me