Remove fDaemon flag checking on return from main(), which is useless and... #4197

pull 4tar wants to merge 1 commits into bitcoin:master from 4tar:master changing 1 files +1 −8
  1. 4tar commented at 5:40 PM on May 19, 2014: contributor

    ... looks really strange.

    Logically nothing is done by the checking, removing it makes things simpler and clearer.

    Signed-off-by: Huang Le 4tarhl@gmail.com

  2. Remove fDaemon flag checking on return from main(), which is useless and looks really strange. 0b78ba8ad6
  3. in src/bitcoind.cpp:None in 0b78ba8ad6
     183 | -
     184 | -    if (fRet && fDaemon)
     185 | -        return 0;
     186 | -
     187 | -    return (fRet ? 0 : 1);
     188 | +    return (AppInit(argc, argv) ? 0 : 1);
    


    sipa commented at 5:43 PM on May 19, 2014:

    How about:

      return !AppInit(argc, argv);
    

    4tar commented at 9:15 AM on May 20, 2014:

    !AppInit() is fine also, but keeping the conditional expression reminders reader about the value type: AppInit() returns a bool while main() returns an int. Just my 2 cents.


    laanwj commented at 10:35 AM on May 20, 2014:

    @4tar yeah - I think it makes some sense to enumerate the values here, as the RPC client can return other exit codes than 0 and 1 (which it does directly in AppInit() through exit(), which is damn ugly, but RPC client functionality is going to be removed from bitcoind anyway).

  4. laanwj commented at 6:01 PM on May 19, 2014: member

    Huh, that check is indeed strange. ACK on removing it.

  5. BitcoinPullTester commented at 6:19 PM on May 19, 2014: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/0b78ba8ad69d55817f2b62c631a71b5ac32549f1 for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  6. laanwj merged this on May 20, 2014
  7. laanwj closed this on May 20, 2014

  8. laanwj referenced this in commit 9d97e83bf6 on May 20, 2014
  9. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-29 03:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me