add getpeerinfo to btcctl

This commit is contained in:
David Hill 2013-10-21 13:26:40 -04:00
parent a975b60a0a
commit e1a02d71b3

View file

@ -156,6 +156,18 @@ func main() {
break break
} }
fmt.Printf("%v\n", reply.(bool)) fmt.Printf("%v\n", reply.(bool))
case "getpeerinfo":
msg, err := btcjson.CreateMessage("getpeerinfo")
if err != nil {
fmt.Printf("CreateMessage: %v\n", err)
break
}
reply, err := send(&cfg, msg)
if err != nil {
fmt.Printf("RpcCommand: %v\n", err)
break
}
spew.Dump(reply)
case "getrawmempool": case "getrawmempool":
msg, err := btcjson.CreateMessage("getrawmempool") msg, err := btcjson.CreateMessage("getrawmempool")
if err != nil { if err != nil {
@ -226,6 +238,7 @@ func usage(parser *flags.Parser) {
"\tgetconnectioncount\n"+ "\tgetconnectioncount\n"+
"\tgetdifficulty\n"+ "\tgetdifficulty\n"+
"\tgetgenerate\n"+ "\tgetgenerate\n"+
"\tgetpeerinfo\n"+
"\tgetrawmempool\n"+ "\tgetrawmempool\n"+
"\tgetrawtransaction <txhash>\n"+ "\tgetrawtransaction <txhash>\n"+
"\tstop\n") "\tstop\n")