kaspad/server/rpc/handle_notify_chain_changes.go
Svarog 369ec449a8 [NOD-509] Change organization name to kaspanet (#524)
* [NOD-509] Change organization name to kaspanet

* [NOD-509] Reorganize imports
2019-12-08 17:33:42 +02:00

20 lines
569 B
Go

package rpc
import "github.com/kaspanet/kaspad/btcjson"
// handleNotifyChainChanges implements the notifyChainChanges command extension for
// websocket connections.
func handleNotifyChainChanges(wsc *wsClient, icmd interface{}) (interface{}, error) {
if wsc.server.cfg.AcceptanceIndex == nil {
return nil, &btcjson.RPCError{
Code: btcjson.ErrRPCNoAcceptanceIndex,
Message: "The acceptance index must be " +
"enabled to receive chain changes " +
"(specify --acceptanceindex)",
}
}
wsc.server.ntfnMgr.RegisterChainChanges(wsc)
return nil, nil
}