aboutsummaryrefslogtreecommitdiff
path: root/src/rpcnet.cpp
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@exmulti.com>2012-06-28 23:18:38 -0400
committerJeff Garzik <jgarzik@redhat.com>2012-06-28 23:18:38 -0400
commit70ab73a0087cbb0d6b26c9ad58146ae542b1b9be (patch)
tree4b65de10c0606f765d4c1b99bfcb3a2825f7dc0c /src/rpcnet.cpp
parent5fa83965f22ae92f86de74104b621c2168d37698 (diff)
downloadbitcoin-70ab73a0087cbb0d6b26c9ad58146ae542b1b9be.tar.xz
Create new rpcnet module, and move 'getconnectioncount' RPC to it
Diffstat (limited to 'src/rpcnet.cpp')
-rw-r--r--src/rpcnet.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp
new file mode 100644
index 0000000000..1c27d0ef8c
--- /dev/null
+++ b/src/rpcnet.cpp
@@ -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();
+}
+
+