aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoinrpc.cpp
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@exmulti.com>2012-06-22 11:43:34 -0400
committerJeff Garzik <jgarzik@redhat.com>2012-06-22 11:43:34 -0400
commit25d5c195228279b8fd891f2a7767d0529aee0ffd (patch)
tree2da60e657e3881bfa962258cc680bc14ffde9427 /src/bitcoinrpc.cpp
parenta08e1826981e02c7a5f18fc30b4f40a780e4e86d (diff)
RPC: add 'getrawmempool', listing all transaction ids in memory pool
Diffstat (limited to 'src/bitcoinrpc.cpp')
-rw-r--r--src/bitcoinrpc.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp
index 8c3a615fd1..9dd6774984 100644
--- a/src/bitcoinrpc.cpp
+++ b/src/bitcoinrpc.cpp
@@ -2194,6 +2194,23 @@ Value getmemorypool(const Array& params, bool fHelp)
}
}
+Value getrawmempool(const Array& params, bool fHelp)
+{
+ if (fHelp || params.size() != 0)
+ throw runtime_error(
+ "getrawmempool\n"
+ "Returns all transaction ids in memory pool.");
+
+ vector<uint256> vtxid;
+ mempool.queryHashes(vtxid);
+
+ Array a;
+ BOOST_FOREACH(const uint256& hash, vtxid)
+ a.push_back(hash.ToString());
+
+ return a;
+}
+
Value getblockhash(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
@@ -2317,6 +2334,7 @@ static const CRPCCommand vRPCCommands[] =
{ "sendfrom", &sendfrom, false },
{ "sendmany", &sendmany, false },
{ "addmultisigaddress", &addmultisigaddress, false },
+ { "getrawmempool", &getrawmempool, true },
{ "getblock", &getblock, false },
{ "getblockhash", &getblockhash, false },
{ "gettransaction", &gettransaction, false },