Merged
Conversation
|
I love it as it makes the code so much more readable, great pull IMO. |
Replace all "magic values" in RPCError(...) by constants.
Member
|
ACK. |
Contributor
|
ACK |
1 similar comment
Contributor
|
ACK |
This was referenced Jul 15, 2013
Closed
brotchie
added a commit
to brotchie/node-dogecoin
that referenced
this pull request
Jan 30, 2014
Added error codes as defined in bitcoin/bitcoin#1908.
KolbyML
pushed a commit
to KolbyML/bitcoin
that referenced
this pull request
Dec 5, 2020
1947519 [Cleanup] Remove unneeded "fix" for segfault with getinfo on startup (random-zebra) 84acfa1 [RPC] Throw immediately if RPC is used when the server is in warmup (random-zebra) Pull request description: **Problem**: Most RPC commands crash the wallet during the initialization phase. **Solution**: An attempt to fix this specifically for `getinfo` was made in bitcoin#543, checking the existence of `chainActive.Tip()`. A better solution, instead of checking all places that try to access the block index, (or the chainstate, or the second layer maps, etc...), is to throw a JSON-RPC exception with any call, if the server is still in warm-up phase (returning the exact init message), directly from `CRPCTable::execute`. Closes bitcoin#1908 ACKs for top commit: furszy: ACK 1947519 Fuzzbawls: utACK 1947519 Tree-SHA512: 4f37e512cb411473135c6d1fbb5013bddbcfca62b8a1ed6777481e90f60374480e3617ed1329a10d3cb1e614a2f17a827da2dce1da793b0db3c6b13222cdec19
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.
I performed some code archeology to retroactively name and document the JSONRPC error codes.
This pull has no code changes.
Feel free to suggest other names for the errors.
This pull reveals some inconsistencies in the error codes thrown, for example,
-3is sometimes used for "Invalid bitcoin address" sometimes i.s.o-5, but as to not change the interface I decided against addressing this. This can be left for a later pull (or never, and just documented as part of the API).I've also added constants for the HTTP status codes.