Add stop command to rpcserver.

This commit is contained in:
John C. Vernaleo 2013-08-09 16:20:06 -04:00
parent a3531957f4
commit 00cd730c3f

View file

@ -150,6 +150,13 @@ func jsonRpcRead(w http.ResponseWriter, r *http.Request, s *rpcServer) {
// Deal with commands // Deal with commands
switch message.Method { switch message.Method {
case "stop":
rawReply = btcjson.Reply{
Result: "btcd stopping.",
Error: nil,
Id: &message.Id,
}
s.server.Stop()
case "getblockcount": case "getblockcount":
_, maxidx, _ := s.server.db.NewestSha() _, maxidx, _ := s.server.db.NewestSha()
rawReply = btcjson.Reply{ rawReply = btcjson.Reply{