@@ -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." );
@@ -1200,6 +1204,10 @@ UniValue getcompactsketch(const JSONRPCRequest& request)
12001204 }
12011205 }.ToString ());
12021206
1207+ if (!g_con_elementsmode) {
1208+ 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>`" );
1209+ }
1210+
12031211 CBlock block;
12041212 std::vector<unsigned char > block_bytes (ParseHex (request.params [0 ].get_str ()));
12051213 CDataStream ssBlock (block_bytes, SER_NETWORK, PROTOCOL_VERSION);
@@ -1238,6 +1246,10 @@ UniValue consumecompactsketch(const JSONRPCRequest& request)
12381246 }
12391247 }.ToString ());
12401248
1249+ if (!g_con_elementsmode) {
1250+ 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>`" );
1251+ }
1252+
12411253 UniValue ret (UniValue::VOBJ);
12421254
12431255 std::vector<unsigned char > compact_block_bytes (ParseHex (request.params [0 ].get_str ()));
@@ -1307,6 +1319,10 @@ UniValue consumegetblocktxn(const JSONRPCRequest& request)
13071319 }
13081320 }.ToString ());
13091321
1322+ if (!g_con_elementsmode) {
1323+ 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>`" );
1324+ }
1325+
13101326 CBlock block;
13111327 std::vector<unsigned char > block_bytes (ParseHex (request.params [0 ].get_str ()));
13121328 CDataStream ssBlock (block_bytes, SER_NETWORK, PROTOCOL_VERSION);
@@ -1352,6 +1368,10 @@ UniValue finalizecompactblock(const JSONRPCRequest& request)
13521368 }
13531369 }.ToString ());
13541370
1371+ if (!g_con_elementsmode) {
1372+ 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>`" );
1373+ }
1374+
13551375 // Compact block
13561376 std::vector<unsigned char > compact_block_bytes (ParseHex (request.params [0 ].get_str ()));
13571377 CDataStream ssCompactBlock (compact_block_bytes, SER_NETWORK, PROTOCOL_VERSION);
@@ -1406,6 +1426,10 @@ UniValue testproposedblock(const JSONRPCRequest& request)
14061426 }
14071427 }.ToString ());
14081428
1429+ if (!g_con_elementsmode) {
1430+ 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>`" );
1431+ }
1432+
14091433 CBlock block;
14101434 if (!DecodeHexBlk (block, request.params [0 ].get_str ()))
14111435 throw JSONRPCError (RPC_DESERIALIZATION_ERROR, " Block decode failed" );
0 commit comments