mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-20 13:56:45 +00:00

* Call UpdatePruningPointIfRequired when resolving virtual * Don't sanity check pruning point UTXO set if it's genesis * Add UpdatePruningPointIfRequired on init
21 lines
664 B
Go
21 lines
664 B
Go
package rpcclient
|
|
|
|
import "github.com/kaspanet/kaspad/app/appmessage"
|
|
|
|
// Ban sends an RPC request respective to the function's name and returns the RPC server's response
|
|
func (c *RPCClient) Ban(ip string) (*appmessage.BanResponseMessage, error) {
|
|
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewBanRequestMessage(ip))
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
response, err := c.route(appmessage.CmdBanRequestMessage).DequeueWithTimeout(c.timeout)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
banResponse := response.(*appmessage.BanResponseMessage)
|
|
if banResponse.Error != nil {
|
|
return nil, c.convertRPCError(banResponse.Error)
|
|
}
|
|
return banResponse, nil
|
|
}
|