Skip to content

Commit

Permalink
feat: add listbanned
Browse files Browse the repository at this point in the history
  • Loading branch information
gridcat committed Jul 6, 2021
1 parent da8ce00 commit 95dd7d4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/RPC/Network.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Banned } from '../contracts/banned';
import { Block, BlockWithTX } from '../contracts/block';
import { BlockchainDifficulty, BlockchainInfo } from '../contracts/blockchainInfo';
import { BurnReport } from '../contracts/burnReport';
Expand Down Expand Up @@ -237,4 +238,14 @@ export class Network extends RPCBase {
public async getRawMempool(): Promise<string[]> {
return this.call('getrawmempool');
}

/**
* List all banned IPs/subnets.
*
* @returns {Promise<Banned>}
* @memberof Network
*/
public async listBanned(): Promise<Banned> {
return this.call('listbanned');
}
}
6 changes: 6 additions & 0 deletions src/contracts/banned.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface Banned {
address: string;
bannedUntil: number;
banCreated: number;
banReason: string;
}

0 comments on commit 95dd7d4

Please sign in to comment.