Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getrawtransaction RPC call broken in 0.18.8: confirmations, time and blocktime parameters missing in response #303

Closed
c0deright opened this issue Feb 12, 2019 · 6 comments
Labels

Comments

@c0deright
Copy link

c0deright commented Feb 12, 2019

RPC call getrawtransaction is broken in 0.18.8

Can you reliably reproduce the issue?

yes

If so, please list the steps to reproduce below:

  1. install abc-0.18.8 on linux
  2. issue the following command: bitcoin-cli getrawtransaction [someTXID from your wallet] true

Expected behaviour

JSON-Output should contain (in my case) the following data after vin and vout:

(..)
"vin": [
  (..)
],
"vout": [
  (..)
],
"blockhash": "000000000000000006b7e3fae05eda7bc578da13eb0220291b3668b1424b6353",
"confirmations": 8899,
"time": 1544630389,
"blocktime": 1544630389

Actual behaviour

JSON-Output is missing confirmations, time and blocktime:

(..)
"vin": [
  (..)
],
"vout": [
  (..)
],
"blockhash": "000000000000000006b7e3fae05eda7bc578da13eb0220291b3668b1424b6353"

What version of bitcoin-abc are you using?

Bitcoin ABC Daemon version v0.18.7.0-g1da1ddd10, selfcompiled under Ubuntu 16.04 LTS

Any extra information that might be useful in the debugging process.

  • Works with abc-0.18.7
  • The TXID in question is one of a watch-only address which was added to the wallet.dat some time ago (bitcoind running with txindex=1, of course)
  • the node is only used to monitor certain watch-only addresses and has no private keys in wallet.dat (besides the one added automatically when wallet.dat was generated)
@c0deright
Copy link
Author

c0deright commented Feb 13, 2019

@jnewbery
Care to comment? This is a major showstopper for us and your commit could be the cause of that

@jnewbery
Copy link
Contributor

Hi @c0deright. I contribute to the Bitcoin Core project (https://github.com/bitcoin/bitcoin), which is the reference implementation of the Bitcoin protocol. Despite the confusing naming, this project (Bitcoin-ABC) and protocol (Bitcoin Cash) have nothing to do with Bitcoin.

The code in the commit that you reference is indeed taken from a contribution of mine, to Bitcoin Core, here: https://github.com/bitcoin/bitcoin/pull/8824/files. However, the backport was misapplied. Despite the comment being include (Blockchain contextual information (confirmations and blocktime) is not available to code in bitcoin-common, so we query them here and push the data into the returned UniValue.), the code to do that wasn't.

The Bitcoin Cash maintainers are of course permitted to use my code (fully or partially), since it is licensed under the MIT license. That license states THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED... IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY.... Neither I nor the Bitcoin-ABC maintainers are 'the cause' of your showstopper.

Feel free to contribute a PR to Bitcoin-ABC fix this bug. Or not. I don't really care. But please don't summon me to this project again. Thanks!

@c0deright
Copy link
Author

Hi @jnewbery. Sorry, my mistake. I just looked at the commit history of that file. My bad.

@jasonbcox
Copy link
Contributor

@c0deright Thanks for reporting. Indeed the backport was misapplied. I'm working on a fix: https://reviews.bitcoinabc.org/D2546

@jasonbcox jasonbcox added the bug label Feb 14, 2019
@jasonbcox
Copy link
Contributor

It's been landed on master, so this fix will be available in the next release (0.19)

@grittibaenz
Copy link

@c0deright thanks for reporting, we ran into the same bug.

deadalnix pushed a commit that referenced this issue Feb 15, 2019
Summary:
Fixes a regression from D2499 where `confirmations`, `time`, and `blocktime` are no longer present in getrawtransaction.  Also add sanity checks to rpc_rawtransaction.py to ensure these verbose-only values are included in the future.

This fixes this issue reported on Github: #303

Test Plan:
```
ninja check
test_runner.py
```

Reviewers: deadalnix, Fabien, #bitcoin_abc

Reviewed By: deadalnix, #bitcoin_abc

Subscribers: teamcity, schancel

Differential Revision: https://reviews.bitcoinabc.org/D2546
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants