mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-11 00:26:44 +00:00
20 lines
569 B
Go
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
|
|
}
|