Blockpool better timeouts, download rate observation, quicker switching to consensus; Id -> ID (sorry, this doesn't belong here)

This commit is contained in:
Jae Kwon
2015-08-18 10:51:55 -07:00
parent 65ecf4b3a2
commit 625f23af13
24 changed files with 478 additions and 371 deletions

View File

@ -76,7 +76,7 @@ func (wsc *WSClient) receiveEventsRoutine() {
wsc.Stop()
break
}
if strings.HasSuffix(response.Id, "#event") {
if strings.HasSuffix(response.ID, "#event") {
wsc.EventsCh <- *response.Result.(*ctypes.ResultEvent)
} else {
wsc.ResultsCh <- response.Result
@ -89,7 +89,7 @@ func (wsc *WSClient) receiveEventsRoutine() {
func (wsc *WSClient) Subscribe(eventid string) error {
err := wsc.WriteJSON(rpctypes.RPCRequest{
JSONRPC: "2.0",
Id: "",
ID: "",
Method: "subscribe",
Params: []interface{}{eventid},
})
@ -100,7 +100,7 @@ func (wsc *WSClient) Subscribe(eventid string) error {
func (wsc *WSClient) Unsubscribe(eventid string) error {
err := wsc.WriteJSON(rpctypes.RPCRequest{
JSONRPC: "2.0",
Id: "",
ID: "",
Method: "unsubscribe",
Params: []interface{}{eventid},
})