mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Fix bitcoin-cli exit status code
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "util.h"
|
||||
#include "init.h"
|
||||
#include "rpcclient.h"
|
||||
#include "rpcprotocol.h"
|
||||
#include "ui_interface.h" /* for _(...) */
|
||||
#include "chainparams.h"
|
||||
|
||||
@@ -55,23 +56,25 @@ int main(int argc, char* argv[])
|
||||
try
|
||||
{
|
||||
if(!AppInitRPC(argc, argv))
|
||||
return 1;
|
||||
return abs(RPC_MISC_ERROR);
|
||||
}
|
||||
catch (std::exception& e) {
|
||||
PrintExceptionContinue(&e, "AppInitRPC()");
|
||||
return abs(RPC_MISC_ERROR);
|
||||
} catch (...) {
|
||||
PrintExceptionContinue(NULL, "AppInitRPC()");
|
||||
return abs(RPC_MISC_ERROR);
|
||||
}
|
||||
|
||||
int ret = abs(RPC_MISC_ERROR);
|
||||
try
|
||||
{
|
||||
if(!CommandLineRPC(argc, argv))
|
||||
return 1;
|
||||
ret = CommandLineRPC(argc, argv);
|
||||
}
|
||||
catch (std::exception& e) {
|
||||
PrintExceptionContinue(&e, "CommandLineRPC()");
|
||||
} catch (...) {
|
||||
PrintExceptionContinue(NULL, "CommandLineRPC()");
|
||||
}
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user