The RPC examples previously used an invalid 63-character txid, causing errors such as:
0build/src/bitcoin-cli gettransaction "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d" true
1error code: -8
2error message:
3txid must be of length 64 (not 63, for '1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d')
This commit replaces the invalid txid with a valid one from https://github.com/bitcoin/bitcoin/blob/df5c643f92d4a6b1ef4dfe4b9c54f902990bb54b/src/validation.cpp#L2582
You can verify the fix by checking the following:
The original txid does not exist:
The new txid is valid:
Or use the commands below to validate locally:
0# Build the Bitcoin Core binaries
1cmake -B build && cmake --build build -j$(nproc)
2
3# Start bitcoind with an up-to-date datadir and txindex enabled
4build/src/bitcoind -datadir="~/your-up-to-date-bitcoin-datadir" -daemon -txindex=1
5
6# Wait a few seconds, then test the txids
7build/src/bitcoin-cli getrawtransaction "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d" # invalid
8build/src/bitcoin-cli getrawtransaction "d4f7fbbf92f4a3014a230b2dc70b8058d02eb36ac06b4a0736d9d60eaa9e8781" # valid
9
10# Stop bitcoind to clean up
11build/src/bitcoin-cli stop