Add stop command to rpcserver.
This commit is contained in:
parent
a3531957f4
commit
00cd730c3f
1 changed files with 7 additions and 0 deletions
|
@ -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{
|
||||||
|
|
Loading…
Reference in a new issue