mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-07 03:03:58 +01:00
Create new rpcnet module, and move 'getconnectioncount' RPC to it
This commit is contained in:
21
src/rpcnet.cpp
Normal file
21
src/rpcnet.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
// Copyright (c) 2009-2012 Bitcoin Developers
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include "net.h"
|
||||
#include "bitcoinrpc.h"
|
||||
|
||||
using namespace json_spirit;
|
||||
using namespace std;
|
||||
|
||||
Value getconnectioncount(const Array& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() != 0)
|
||||
throw runtime_error(
|
||||
"getconnectioncount\n"
|
||||
"Returns the number of connections to other nodes.");
|
||||
|
||||
return (int)vNodes.size();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user