RPC: Improve error messages on RPC endpoints that use GetTransaction#13144
Closed
jimpo wants to merge 5 commits into
Closed
RPC: Improve error messages on RPC endpoints that use GetTransaction#13144jimpo wants to merge 5 commits into
jimpo wants to merge 5 commits into
Conversation
fanquake
reviewed
May 2, 2018
Member
There was a problem hiding this comment.
F841 local variable 'prevout_index' is assigned to but never used
Member
|
Same error on two of the linux builds: |
c060157 to
0453681
Compare
promag
reviewed
May 3, 2018
Contributor
There was a problem hiding this comment.
nStatus requires cs_main lock?
promag
reviewed
May 13, 2018
Contributor
There was a problem hiding this comment.
IMO this could be removed (lines 193 to 200), does't test error messages.
Contributor
Author
There was a problem hiding this comment.
The purpose of the assertion on line 199 is to test that the error received on 192 goes away after transaction is in the mempool.
Contributor
There was a problem hiding this comment.
Right, a comment there would be nice then, like:
# No error should be raised now that the transaction is known.
Contributor
There was a problem hiding this comment.
nit, could put allow_slow after tx_hash.
0453681 to
1fdf98d
Compare
Contributor
| Needs rebase |
1fdf98d to
344d645
Compare
344d645 to
9ca6754
Compare
Contributor
| Needs rebase |
9ca6754 to
59b3ab2
Compare
59b3ab2 to
a42534e
Compare
Contributor
|
Concept ACK, checked and it rebases cleanly |
added 5 commits
July 16, 2018 09:27
The error messages now indicate the status of the txindex.
This breaks a circular dependency between validation and txindex.
Break out GetTransactionInBlock into a separate method.
Since both the REST and RPC APIs use GetTransaction, there is no need to duplicate the error handling logic.
a42534e to
12c4386
Compare
Contributor
| Needs rebase |
Contributor
| There hasn't been much activity lately and the patch still needs rebase, so I am closing this for now. Please let me know when you want to continue working on this, so the pull request can be re-opened. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This contains some follow up items from #13033.
The PR refactors the GetTransaction function and moves it from validation to rpc/rawtransaction. This breaks a cyclic dependency between validation and index/txindex pointed out by @sipa. Also, the REST transaction API and gettxoutproof RPC now have more clear error messages when the txindex is not available, as requested by @TheBlueMatt.
This would also be a good opportunity to drop the slow tx lookup through the unspent coins view if people are for it, as proposed in #3220.