Skip to content

Commit 91adeec

Browse files
committed
[DHT] Fixup spork check for hash table RPC commands
1 parent 7494175 commit 91adeec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/dht/rpcdht.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ UniValue dhtputmessages(const JSONRPCRequest& request)
582582
HelpExampleRpc("dhtputmessages", ""));
583583

584584
if (!sporkManager.IsSporkActive(SPORK_30_ACTIVATE_BDAP))
585-
throw std::runtime_error("BDAP_DHT_RPC_ERROR: ERRCODE: 3000 - " + _("Can not use DHT until BDAP spork is active."));
585+
throw JSONRPCError(RPC_BDAP_SPORK_INACTIVE, strprintf("Can not use the DHT until the BDAP spork is active."));
586586

587587
UniValue result(UniValue::VOBJ);
588588

@@ -637,7 +637,7 @@ UniValue dhtgetmessages(const JSONRPCRequest& request)
637637
HelpExampleRpc("dhtgetmessages", ""));
638638

639639
if (!sporkManager.IsSporkActive(SPORK_30_ACTIVATE_BDAP))
640-
throw std::runtime_error("BDAP_DHT_RPC_ERROR: ERRCODE: 3000 - " + _("Can not use DHT until BDAP spork is active."));
640+
throw JSONRPCError(RPC_BDAP_SPORK_INACTIVE, strprintf("Can not use the DHT until the BDAP spork is active."));
641641

642642
UniValue result(UniValue::VOBJ);
643643

@@ -1227,7 +1227,7 @@ UniValue dht_rpc(const JSONRPCRequest& request)
12271227
if (strCommand == "getmutable" || strCommand == "putmutable" ||
12281228
strCommand == "getrecord" || strCommand == "putrecord" || strCommand == "clearrecord" ||
12291229
strCommand == "getlinkrecord" || strCommand == "putlinkrecord" || strCommand == "clearlinkrecord" || strCommand == "getalllinkrecords" ||
1230-
strCommand == "status")
1230+
strCommand == "status" || strCommand == "reannounce" || strCommand == "events")
12311231
{
12321232
if (!sporkManager.IsSporkActive(SPORK_30_ACTIVATE_BDAP))
12331233
throw JSONRPCError(RPC_BDAP_SPORK_INACTIVE, strprintf("Can not use the DHT until the BDAP spork is active."));

0 commit comments

Comments
 (0)