aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-12-16 08:42:17 +0100
committerMarcoFalke <falke.marco@gmail.com>2021-12-16 08:42:44 +0100
commita30642926a5ee119ab4e1c97d83f76574f655d26 (patch)
tree9b3cedd66e671f2fd0e8dcedb63b66ee012daa91 /src/rpc
parent98c362a4d3d865b5e5ffe6649ffc33203abf8ac0 (diff)
parent62fa61fa4a33ff4d108a65d656ffe2cac4330824 (diff)
downloadbitcoin-a30642926a5ee119ab4e1c97d83f76574f655d26.tar.xz
Merge bitcoin/bitcoin#23721: wallet, refactor: Move restorewallet() logic to the wallet section
62fa61fa4a33ff4d108a65d656ffe2cac4330824 refactor: remove the wallet folder if the restore fails (w0xlt) abbb7eccef3fc1c36f34756458d2792f6661e29f refactor: Move restorewallet() RPC logic to the wallet section (w0xlt) 4807f73f48f4ff1084fcf7aee94e5b14592bfda8 refactor: Implement restorewallet() logic in the wallet section (w0xlt) Pull request description: Currently `restorewallet()` logic is written in the RPC layer and it canĀ“t be reused by GUI. So it moves this to the wallet section and then, GUI can access it. This is necessary to implement the "Restore Wallet" menu item in the GUI (which is already implemented in https://github.com/bitcoin-core/gui/pull/471 ). This commit also simplifies error handling and adds a new behavior: if the restore fails, the invalid wallet folder is removed. ACKs for top commit: achow101: ACK 62fa61fa4a33ff4d108a65d656ffe2cac4330824 shaavan: crACK 62fa61fa4a33ff4d108a65d656ffe2cac4330824 Tree-SHA512: 7ccfbad5943f38616ba0c2dd443c97a4b5bc1f6612dbf5a9e7a0263100aba36671fae929a2e7688442667be394645f44484af137a4802f204a33c4689eb27c39
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/protocol.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/rpc/protocol.h b/src/rpc/protocol.h
index fc00a1efad..2fc9f55eba 100644
--- a/src/rpc/protocol.h
+++ b/src/rpc/protocol.h
@@ -80,6 +80,7 @@ enum RPCErrorCode
RPC_WALLET_NOT_FOUND = -18, //!< Invalid wallet specified
RPC_WALLET_NOT_SPECIFIED = -19, //!< No wallet specified (error when there are multiple wallets loaded)
RPC_WALLET_ALREADY_LOADED = -35, //!< This same wallet is already loaded
+ RPC_WALLET_ALREADY_EXISTS = -36, //!< There is already a wallet with the same name
//! Backwards compatible aliases
RPC_WALLET_INVALID_ACCOUNT_NAME = RPC_WALLET_INVALID_LABEL_NAME,