ElementsProject / ElementsProject/elements
`fundrawtransaction` crashes a node with watch-only wallet when not imported UTXO in the inputs
- Dominant language
- C++
- Stars
- 1.2k
- Forks
- 416
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 15
Description
I can make my regtest node reliably crash when:
* wallet is watch-only (private keys deactivated)
* I call `fundrawtransaction` with a transaction which has 1 input (spending either L-BTC or an asset) which is **not** followed in the wallet and 1 output in L-BTC
* I don't pass optional argument, but the result is the same if I add either a change address, `includeWatching` or both
* I know this is caused by the input not being in the wallet since the issue disappeared when I imported the corresponding address in the wallet
Elements should fail with an explicit error message about why it can't fund the transaction.
Instead it crashes with the following error: `error: Could not connect to the server 127.0.0.1:28433 (error code 1 - "EOF reached")`
The issue should be reproducible by following those steps
1. Start a new node
2. create a new wallet with private keys deactivated and unload default wallet
3. run `createrawtransaction` with adding of an explicit input that is not followed by the watch-only wallet.
4. call `fundrawtransaction` with the resulting raw transaction as an argument
I compiled elements master branch about a week ago, here's the output of `elementsd --version`: `Elements Core Daemon version v0.18.99.0-ec9b28e08`
I'm running Ubuntu 20.04, with an AMD cpu and a SSD
Contributor guide
Assessment
This issue has not been assessed yet.