From 2e3a48dcea5d171b57527de241a28484fcab55d9 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Thu, 5 Jan 2012 16:54:55 -0800 Subject: [PATCH] Small cleanups/fixes. --- ConnectionPool.cpp | 2 +- Issues | 3 ++- Ledger.h | 12 ++++++------ PubKeyCache.h | 2 +- RPCServer.cpp | 4 ++++ RPCServer.h | 2 +- UniqueNodeList.cpp | 2 +- rpc.cpp | 7 ++----- 8 files changed, 18 insertions(+), 16 deletions(-) diff --git a/ConnectionPool.cpp b/ConnectionPool.cpp index 5c1ac56167..ee89a7c5d5 100644 --- a/ConnectionPool.cpp +++ b/ConnectionPool.cpp @@ -22,7 +22,7 @@ void ConnectionPool::connectToNetwork(KnownNodeList& nodeList,boost::asio::io_se if(!node) return; Peer::pointer peer=Peer::create(io_service); - peer->connectTo(*node); +// peer->connectTo(*node); // FIXME mPeers.push_back(peer); } diff --git a/Issues b/Issues index ecb30f6eba..3773b82bae 100644 --- a/Issues +++ b/Issues @@ -1,8 +1,9 @@ Issues we know about but have not resolved yet: -Generate/send session key , sign TCP parameters. This will prevent a +Generate/send session key, sign TCP parameters. This will prevent a filtering proxy and prevent us from making many connections to the same node. We need a maximum message size. + diff --git a/Ledger.h b/Ledger.h index e34916b312..430da928d3 100644 --- a/Ledger.h +++ b/Ledger.h @@ -1,6 +1,12 @@ #ifndef __LEDGER__ #define __LEDGER__ +#include +#include + +#include +#include + #include "Transaction.h" #include "types.h" #include "BitcoinUtil.h" @@ -8,12 +14,6 @@ #include "AccountState.h" #include "SHAMap.h" -#include -#include -#include -#include - - class Ledger : public boost::enable_shared_from_this { // The basic Ledger structure, can be opened, closed, or synching diff --git a/PubKeyCache.h b/PubKeyCache.h index 7e9a0f622a..9f5d37e50d 100644 --- a/PubKeyCache.h +++ b/PubKeyCache.h @@ -3,7 +3,7 @@ #include -#include "boost/thread/mutex.hpp" +#include #include "uint256.h" #include "key.h" diff --git a/RPCServer.cpp b/RPCServer.cpp index 8ac83e8433..77ff2c4faa 100644 --- a/RPCServer.cpp +++ b/RPCServer.cpp @@ -183,16 +183,19 @@ Json::Value RPCServer::doAccountInfo(Json::Value ¶ms) Json::Value RPCServer::doNewAccount(Json::Value ¶ms) { // newaccount + return "Not yet"; } Json::Value RPCServer::doLock(Json::Value ¶ms) { // lock // lock + return "Not yet"; } Json::Value RPCServer::doUnlock(Json::Value ¶ms) { // unlock // unlock "" + return "Not yet"; } Json::Value RPCServer::doFamilyInfo(Json::Value ¶ms) @@ -290,6 +293,7 @@ Json::Value RPCServer::doSendTo(Json::Value& params) { // Implement simple sending without gathering // sendto // sendto + return "Not yet"; } Json::Value RPCServer::doCommand(const std::string& command, Json::Value& params) diff --git a/RPCServer.h b/RPCServer.h index 24970b925a..4add540f3e 100644 --- a/RPCServer.h +++ b/RPCServer.h @@ -36,7 +36,7 @@ class RPCServer : public boost::enable_shared_from_this Json::Value doLock(Json::Value& params); Json::Value doUnlock(Json::Value& params); Json::Value doSendTo(Json::Value& params); - + public: typedef boost::shared_ptr pointer; diff --git a/UniqueNodeList.cpp b/UniqueNodeList.cpp index 3dfe6577e4..7e20294a45 100644 --- a/UniqueNodeList.cpp +++ b/UniqueNodeList.cpp @@ -69,7 +69,7 @@ void UniqueNodeList::dumpUNL(std::string& retStr) while(db->getNextRow()) { uint160 hanko; - int size=db->getBinary("Hanko", hanko.begin(), hanko.GetSerializeSize()); + db->getBinary("Hanko", hanko.begin(), hanko.GetSerializeSize()); std::string tstr; u160ToHuman(hanko, tstr); diff --git a/rpc.cpp b/rpc.cpp index 8f3ef2c46b..c06997cee6 100644 --- a/rpc.cpp +++ b/rpc.cpp @@ -229,11 +229,8 @@ std::string JSONRPCRequest(const std::string& strMethod, const Json::Value& para std::string JSONRPCReply(const Json::Value& result, const Json::Value& error, const Json::Value& id) { - Json::Value reply; - if (!error.isNull()) - reply["result"]=Json::Value(); - else - reply["result"]=result; + Json::Value reply(Json::objectValue); + reply["result"]=result; reply["error"]=error; reply["id"]=id; Json::FastWriter writer;