<!-- This issue tracker is only for technical issues related to Bitcoin Core. General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com. For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/. If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue! -->
<!-- Describe the issue -->
I've updated from 0.16 to 0.17 and I'm trying to create a raw transaction to be signed on an offline wallet. This used to work fine, but now it doesn't.
I'm creating a raw transaction with createrawtransaction with no inputs and the desired output. I'm using the hex generated in fundrawtransaction to match inputs.
Since the online wallet is watch only I need to pass includeWatching in params. Also I want to send the change amount to a different address, so I added changeAddress to the options hash. This command kills the entire bitcoind process with no warnings and no log messages
This is the commands I've tried and their output:
$ bitcoin-cli createrawtransaction '[]' '{"14XbnUUvc2Kt8TrnnEG9zjF1XM2jYD1h8x":0.001}'
020000000001a0860100000000001976a91426b1e477be0f7bc5e2cf12dd5b973e57e7fab5bf88ac00000000
$ bitcoin-cli fundrawtransaction 020000000001a0860100000000001976a91426b1e477be0f7bc5e2cf12dd5b973e57e7fab5bf88ac00000000
error code: -4
error message:
Insufficient funds
$ bitcoin-cli fundrawtransaction 020000000001a0860100000000001976a91426b1e477be0f7bc5e2cf12dd5b973e57e7fab5bf88ac00000000 '{"includeWatching":true}'
{
"hex": "02000000016c4262fe490eb44becac4d4aa37f86b4433327ffa40a00a5498006c6ec5b0b240100000000feffffff02089a03000000000017a914ab7dd53603b6b64d3851569b90eeae8f39fd9f0087a0860100000000001976a91426b1e477be0f7bc5e2cf12dd5b973e57e7fab5bf88ac00000000",
"fee": 0.00000675,
"changepos": 0
}
$ bitcoin-cli fundrawtransaction 020000000001a0860100000000001976a91426b1e477be0f7bc5e2cf12dd5b973e57e7fab5bf88ac00000000 '{"includeWatching":true,"changeAddress":"185pJS3yVizdE3RtXKALtVbGRv9gzzypT1"}'
error: Could not connect to the server 127.0.0.1:8332 (error code 1 - "EOF reached")
Make sure the bitcoind server is running and that you are connecting to the correct RPC port.
After the last command the bitcoind is no longer running. This error happens every time if I add the changeAddress param.
After looking for a solution in here I've found about gdb. After running gdb --args bitcoind -conf=/home/user/.bitcoin/bitcoin.conf I've got this error:
bitcoind: policy/feerate.cpp:25: CAmount CFeeRate::GetFee(size_t) const: Assertion `nBytes_ <= uint64_t(std::numeric_limits<int64_t>::max())' failed.
Thread 7 "bitcoin-httpwor" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffebfff700 (LWP 22448)]
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
I will not append debug.log because it has no error. The process simply crashes. At first I was thinking this could be an out of memory. But after some digging I can safely say the problem is caused by policy/feerate.cpp#L14