-
Notifications
You must be signed in to change notification settings - Fork 38.7k
rpc: Adjust ifdef to avoid unreachable code #12787
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
rpc: Adjust ifdef to avoid unreachable code #12787
Conversation
|
You could avoid the "guards cross scopes" by moving everything into the else-scope: }else{
// ...
#ifdef ...
return ...wallet
#endif
throw
}Also, would be nice if you added a test for the failure case to |
|
Assigning "refactoring", since it shouldn't change behavior. |
c6ced0a to
61f8298
Compare
|
utACK 61f8298 Travis seems to have timed out so I restarted it. |
|
utACK 61f8298 |
1 similar comment
|
utACK 61f8298 |
What unreachable code? |
|
I'd assume it is a static analyser warning that in |
|
utACK 61f8298. |
|
This code is all disappearing after V0.17 is branched, but fine, utACK 61f8298 |
61f8298 rpc: Adjust ifdef to avoid unreachable code (practicalswift) Pull request description: Adjust `ifdef` to avoid unreachable code. Introduced in 1e79c05. Tree-SHA512: c775cc9181e4034f26c5b219974e06886435275933249b169d2bc8bc98f639c4027e1e7d991f43bded62146a141acee6d3be1f2b313042d9bbc0a5d2e71d6c7c
Summary: 61f8298 rpc: Adjust ifdef to avoid unreachable code (practicalswift) Pull request description: Adjust `ifdef` to avoid unreachable code. Introduced in 1e79c05. Tree-SHA512: c775cc9181e4034f26c5b219974e06886435275933249b169d2bc8bc98f639c4027e1e7d991f43bded62146a141acee6d3be1f2b313042d9bbc0a5d2e71d6c7c Backport of Core PR12787 bitcoin/bitcoin#12787 Test Plan: make check Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3902
61f8298 rpc: Adjust ifdef to avoid unreachable code (practicalswift) Pull request description: Adjust `ifdef` to avoid unreachable code. Introduced in 1e79c05. Tree-SHA512: c775cc9181e4034f26c5b219974e06886435275933249b169d2bc8bc98f639c4027e1e7d991f43bded62146a141acee6d3be1f2b313042d9bbc0a5d2e71d6c7c
61f8298 rpc: Adjust ifdef to avoid unreachable code (practicalswift) Pull request description: Adjust `ifdef` to avoid unreachable code. Introduced in 1e79c05. Tree-SHA512: c775cc9181e4034f26c5b219974e06886435275933249b169d2bc8bc98f639c4027e1e7d991f43bded62146a141acee6d3be1f2b313042d9bbc0a5d2e71d6c7c
Adjust
ifdefto avoid unreachable code.Introduced in 1e79c05.