@@ -1024,6 +1024,10 @@ UniValue getnewblockhex(const JSONRPCRequest& request)
10241024 }
10251025 }.ToString ());
10261026
1027+ if (!g_con_elementsmode) {
1028+ throw JSONRPCError (RPC_INVALID_PARAMETER, " This RPC cannot be used in bitcoin compatibility mode. Note: `-regtest` is Bitcoin's regtest mode, instead try `-chain=<custom chain name>`" );
1029+ }
1030+
10271031 int required_wait = !request.params [0 ].isNull () ? request.params [0 ].get_int () : 0 ;
10281032 if (required_wait < 0 ) {
10291033 throw JSONRPCError (RPC_INVALID_PARAMETER, " min_tx_age must be non-negative." );
@@ -1198,6 +1202,10 @@ UniValue getcompactsketch(const JSONRPCRequest& request)
11981202 }
11991203 }.ToString ());
12001204
1205+ if (!g_con_elementsmode) {
1206+ throw JSONRPCError (RPC_INVALID_PARAMETER, " This RPC cannot be used in bitcoin compatibility mode. Note: `-regtest` is Bitcoin's regtest mode, instead try `-chain=<custom chain name>`" );
1207+ }
1208+
12011209 CBlock block;
12021210 std::vector<unsigned char > block_bytes (ParseHex (request.params [0 ].get_str ()));
12031211 CDataStream ssBlock (block_bytes, SER_NETWORK, PROTOCOL_VERSION);
@@ -1236,6 +1244,10 @@ UniValue consumecompactsketch(const JSONRPCRequest& request)
12361244 }
12371245 }.ToString ());
12381246
1247+ if (!g_con_elementsmode) {
1248+ throw JSONRPCError (RPC_INVALID_PARAMETER, " This RPC cannot be used in bitcoin compatibility mode. Note: `-regtest` is Bitcoin's regtest mode, instead try `-chain=<custom chain name>`" );
1249+ }
1250+
12391251 UniValue ret (UniValue::VOBJ);
12401252
12411253 std::vector<unsigned char > compact_block_bytes (ParseHex (request.params [0 ].get_str ()));
@@ -1305,6 +1317,10 @@ UniValue consumegetblocktxn(const JSONRPCRequest& request)
13051317 }
13061318 }.ToString ());
13071319
1320+ if (!g_con_elementsmode) {
1321+ throw JSONRPCError (RPC_INVALID_PARAMETER, " This RPC cannot be used in bitcoin compatibility mode. Note: `-regtest` is Bitcoin's regtest mode, instead try `-chain=<custom chain name>`" );
1322+ }
1323+
13081324 CBlock block;
13091325 std::vector<unsigned char > block_bytes (ParseHex (request.params [0 ].get_str ()));
13101326 CDataStream ssBlock (block_bytes, SER_NETWORK, PROTOCOL_VERSION);
@@ -1350,6 +1366,10 @@ UniValue finalizecompactblock(const JSONRPCRequest& request)
13501366 }
13511367 }.ToString ());
13521368
1369+ if (!g_con_elementsmode) {
1370+ throw JSONRPCError (RPC_INVALID_PARAMETER, " This RPC cannot be used in bitcoin compatibility mode. Note: `-regtest` is Bitcoin's regtest mode, instead try `-chain=<custom chain name>`" );
1371+ }
1372+
13531373 // Compact block
13541374 std::vector<unsigned char > compact_block_bytes (ParseHex (request.params [0 ].get_str ()));
13551375 CDataStream ssCompactBlock (compact_block_bytes, SER_NETWORK, PROTOCOL_VERSION);
@@ -1404,6 +1424,10 @@ UniValue testproposedblock(const JSONRPCRequest& request)
14041424 }
14051425 }.ToString ());
14061426
1427+ if (!g_con_elementsmode) {
1428+ throw JSONRPCError (RPC_INVALID_PARAMETER, " This RPC cannot be used in bitcoin compatibility mode. Note: `-regtest` is Bitcoin's regtest mode, instead try `-chain=<custom chain name>`" );
1429+ }
1430+
14071431 CBlock block;
14081432 if (!DecodeHexBlk (block, request.params [0 ].get_str ()))
14091433 throw JSONRPCError (RPC_DESERIALIZATION_ERROR, " Block decode failed" );
0 commit comments