Skip to content

Commit a383222

Browse files
committed
[Ed25519] Add spork check to raw bdap RPC calls.
1 parent 8844476 commit a383222

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/bdap/rpcrawbdap.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "primitives/transaction.h"
1414
#include "utilstrencodings.h"
1515
#include "dynode-sync.h"
16+
#include "spork.h"
1617
#ifdef ENABLE_WALLET
1718
#include "wallet/wallet.h"
1819
#endif
@@ -47,6 +48,9 @@ UniValue createrawbdapaccount(const JSONRPCRequest& request)
4748
throw std::runtime_error("Error: Cannot create BDAP Objects while wallet is not synced.");
4849
}
4950

51+
if (!sporkManager.IsSporkActive(SPORK_30_ACTIVATE_BDAP))
52+
throw std::runtime_error("BDAP_ADD_PUBLIC_ENTRY_RPC_ERROR: ERRCODE: 3000 - " + _("Can not create BDAP transactions until spork is active."));
53+
5054
// Format object and domain names to lower case.
5155
std::string strObjectID = request.params[0].get_str();
5256
ToLowerCase(strObjectID);
@@ -198,6 +202,9 @@ UniValue sendandpayrawbdapaccount(const JSONRPCRequest& request)
198202
throw std::runtime_error("Error: Cannot create BDAP Objects while wallet is not synced.");
199203
}
200204

205+
if (!sporkManager.IsSporkActive(SPORK_30_ACTIVATE_BDAP))
206+
throw std::runtime_error("BDAP_ADD_PUBLIC_ENTRY_RPC_ERROR: ERRCODE: 3000 - " + _("Can not create BDAP transactions until spork is active."));
207+
201208
CMutableTransaction mtx;
202209
std::string strHexIn = request.params[0].get_str();
203210
if (!DecodeHexTx(mtx, strHexIn))

0 commit comments

Comments
 (0)