|
5 | 5 | #include "bdap/domainentry.h"
|
6 | 6 | #include "bdap/domainentrydb.h"
|
7 | 7 | #include "bdap/utils.h"
|
8 |
| -#include "dht/ed25519.h" |
9 | 8 | #include "core_io.h" // needed for ScriptToAsmStr
|
| 9 | +#include "dht/ed25519.h" |
10 | 10 | #include "dynodeman.h"
|
| 11 | +#include "dynode-sync.h" |
| 12 | +#include "primitives/transaction.h" |
11 | 13 | #include "rpcprotocol.h"
|
12 | 14 | #include "rpcserver.h"
|
13 |
| -#include "primitives/transaction.h" |
14 | 15 | #include "spork.h"
|
15 |
| -#include "wallet/wallet.h" |
16 | 16 | #include "validation.h"
|
17 |
| -#include "dynode-sync.h" |
| 17 | +#include "wallet/wallet.h" |
18 | 18 |
|
19 | 19 | #include <univalue.h>
|
20 | 20 |
|
@@ -188,7 +188,7 @@ UniValue adduser(const JSONRPCRequest& request)
|
188 | 188 | HelpExampleRpc("adduser", "Alice \"Wonderland, Alice\""));
|
189 | 189 |
|
190 | 190 | if (!dynodeSync.IsBlockchainSynced()) {
|
191 |
| - throw std::runtime_error("Error: Cannot create BDAP Objects while wallet is not synced."); |
| 191 | + throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, strprintf("Cannot create BDAP Objects while wallet is not synced.")); |
192 | 192 | }
|
193 | 193 |
|
194 | 194 | if (!sporkManager.IsSporkActive(SPORK_30_ACTIVATE_BDAP))
|
@@ -517,7 +517,7 @@ UniValue updateuser(const JSONRPCRequest& request)
|
517 | 517 | HelpExampleRpc("updateuser", "Alice \"Updated, Alice\" 365"));
|
518 | 518 |
|
519 | 519 | if (!dynodeSync.IsBlockchainSynced()) {
|
520 |
| - throw std::runtime_error("Error: Cannot create BDAP Objects while wallet is not synced."); |
| 520 | + throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, strprintf("Cannot create BDAP Objects while wallet is not synced.")); |
521 | 521 | }
|
522 | 522 |
|
523 | 523 | if (!sporkManager.IsSporkActive(SPORK_30_ACTIVATE_BDAP))
|
@@ -564,7 +564,7 @@ UniValue updategroup(const JSONRPCRequest& request)
|
564 | 564 | HelpExampleRpc("updategroup", "Duality \"Updated, Duality Blockchain Solutions Group\" 700"));
|
565 | 565 |
|
566 | 566 | if (!dynodeSync.IsBlockchainSynced()) {
|
567 |
| - throw std::runtime_error("Error: Cannot create BDAP Objects while wallet is not synced."); |
| 567 | + throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, strprintf("Cannot create BDAP Objects while wallet is not synced.")); |
568 | 568 | }
|
569 | 569 |
|
570 | 570 | if (!sporkManager.IsSporkActive(SPORK_30_ACTIVATE_BDAP))
|
@@ -679,7 +679,7 @@ UniValue deleteuser(const JSONRPCRequest& request)
|
679 | 679 | HelpExampleRpc("deleteuser", "Alice"));
|
680 | 680 |
|
681 | 681 | if (!dynodeSync.IsBlockchainSynced()) {
|
682 |
| - throw std::runtime_error("Error: Cannot create BDAP Objects while wallet is not synced."); |
| 682 | + throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, strprintf("Cannot create BDAP Objects while wallet is not synced.")); |
683 | 683 | }
|
684 | 684 |
|
685 | 685 | if (!sporkManager.IsSporkActive(SPORK_30_ACTIVATE_BDAP))
|
@@ -724,7 +724,7 @@ UniValue deletegroup(const JSONRPCRequest& request)
|
724 | 724 | HelpExampleRpc("deletegroup", "GroupName"));
|
725 | 725 |
|
726 | 726 | if (!dynodeSync.IsBlockchainSynced()) {
|
727 |
| - throw std::runtime_error("Error: Cannot create BDAP Objects while wallet is not synced."); |
| 727 | + throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, strprintf("Cannot create BDAP Objects while wallet is not synced.")); |
728 | 728 | }
|
729 | 729 |
|
730 | 730 | if (!sporkManager.IsSporkActive(SPORK_30_ACTIVATE_BDAP))
|
@@ -833,7 +833,7 @@ UniValue addgroup(const JSONRPCRequest& request)
|
833 | 833 | HelpExampleRpc("addgroup", "Duality \"Duality Blockchain Solutions Group\""));
|
834 | 834 |
|
835 | 835 | if (!dynodeSync.IsBlockchainSynced()) {
|
836 |
| - throw std::runtime_error("Error: Cannot create BDAP Objects while wallet is not synced."); |
| 836 | + throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, strprintf("Cannot create BDAP Objects while wallet is not synced.")); |
837 | 837 | }
|
838 | 838 |
|
839 | 839 | if (!sporkManager.IsSporkActive(SPORK_30_ACTIVATE_BDAP))
|
|
0 commit comments