setban

setban "subnet" "command" ( bantime absolute )

setban allows you to add or remove an IP/Subnet from the banned list.

Argument #1 – subnet

Type: string, required

Specifies the IP/Subnet (refer to getpeerinfo for the node’s IP) with an optional netmask (default is /32, meaning a single IP).

Argument #2 – command

Type: string, required

Use 'add' to ban the IP/Subnet or 'remove' to unban it.

Argument #3 – bantime

Type: numeric, optional, default=0

Specifies the ban duration in seconds, or, if [absolute] is set, until a specific time. If set to 0 or left empty, the default ban time is 24 hours, which can be changed using the -bantime startup argument.

Argument #4 – absolute

Type: boolean, optional, default=false

If true, bantime must be an absolute timestamp in UNIX epoch time.

Result

null    (json null)

Examples

bitcoinevo-cli setban "192.168.0.6" "add" 86400
bitcoinevo-cli setban "192.168.0.0/24" "add"
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "setban", "params": ["192.168.0.6", "add", 86400]}' -H 'content-type: text/plain;' http://127.0.0.1:7332/