Skip to content

Commit c77c136

Browse files
committed
Fix ipv6 regex
1 parent e2885e8 commit c77c136

File tree

1 file changed

+46
-46
lines changed

1 file changed

+46
-46
lines changed

src/Node.php

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -3,53 +3,53 @@
33
namespace App;
44

55
class Node {
6-
public $blockHeight;
7-
public $pruMode;
8-
public $chain;
9-
public $client;
10-
public $ipv4; // Bool: if ipv4 active
11-
public $ipv6; // Bool: if ipv6 active
12-
public $tor; // Bool: if tor active
13-
public $ipv4Address = 'Unknown';
14-
public $ipv6Address = 'Unknown';
6+
public $blockHeight;
7+
public $pruMode;
8+
public $chain;
9+
public $client;
10+
public $ipv4; // Bool: if ipv4 active
11+
public $ipv6; // Bool: if ipv6 active
12+
public $tor; // Bool: if tor active
13+
public $ipv4Address = 'Unknown';
14+
public $ipv6Address = 'Unknown';
1515
public $torAddress = 'Unknown';
1616
public $torVersion = 'Unkown';
17-
public $ipv4Proxy;
18-
public $ipv6Proxy;
19-
public $torProxy;
20-
public $toConn; // Int: total connections of node
21-
public $cTime; // Current node time
22-
public $uptime; // String: uptime of node
23-
public $serivces;
24-
public $proVer;
25-
public $localRelay;
26-
public $timeOffset;
27-
public $port;
28-
public $minRelayFee;
29-
public $mempoolTx;
30-
public $sizeOfmempoolTx;
31-
public $mempoolMinFee;
32-
public $maxMempool;
33-
public $mempoolUsage;
34-
public $mempoolUsageP;
35-
public $mempoolLimited; // Bool: If mempool is beeing limited
36-
public $tIn;
37-
public $tOut;
38-
public $tTotal; // Int : Total traffic
39-
public $tLimitSet; // Bool : If a t limit is set
40-
public $tLimited; // Bool: Is limit is active
41-
public $tUsed; // Int: In MB amount of t used in current cycle
42-
public $tMax; // Int: In MB the daily t limit
43-
public $tTimeLeft; // Int : Time in minutes that are left till the limit is reset
44-
public $tLimitP; // Int: Percentage of Limit used
45-
public $bHeight; // Int: current block height (as far as node knows)
46-
public $bHeightAgo; // Int: Minutes since last received block
47-
public $hHeight; // Int: current max header height (blocks not download by node)
48-
public $bcSize; // Int: in GB soze of blockchain
49-
public $diff; // Int: current network difficulty
50-
public $hashRate; // Int: current network hash rate
51-
public $mNetTime; // Int: current network mediatime
52-
public $softForks; // Arr: List of current forks
17+
public $ipv4Proxy;
18+
public $ipv6Proxy;
19+
public $torProxy;
20+
public $toConn; // Int: total connections of node
21+
public $cTime; // Current node time
22+
public $uptime; // String: uptime of node
23+
public $serivces;
24+
public $proVer;
25+
public $localRelay;
26+
public $timeOffset;
27+
public $port;
28+
public $minRelayFee;
29+
public $mempoolTx;
30+
public $sizeOfmempoolTx;
31+
public $mempoolMinFee;
32+
public $maxMempool;
33+
public $mempoolUsage;
34+
public $mempoolUsageP;
35+
public $mempoolLimited; // Bool: If mempool is beeing limited
36+
public $tIn;
37+
public $tOut;
38+
public $tTotal; // Int : Total traffic
39+
public $tLimitSet; // Bool : If a t limit is set
40+
public $tLimited; // Bool: Is limit is active
41+
public $tUsed; // Int: In MB amount of t used in current cycle
42+
public $tMax; // Int: In MB the daily t limit
43+
public $tTimeLeft; // Int : Time in minutes that are left till the limit is reset
44+
public $tLimitP; // Int: Percentage of Limit used
45+
public $bHeight; // Int: current block height (as far as node knows)
46+
public $bHeightAgo; // Int: Minutes since last received block
47+
public $hHeight; // Int: current max header height (blocks not download by node)
48+
public $bcSize; // Int: in GB soze of blockchain
49+
public $diff; // Int: current network difficulty
50+
public $hashRate; // Int: current network hash rate
51+
public $mNetTime; // Int: current network mediatime
52+
public $softForks; // Arr: List of current forks
5353

5454
function __construct() {
5555
global $bitcoind;
@@ -84,7 +84,7 @@ function __construct() {
8484
if(preg_match("/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/", $ipAddress["address"])){
8585
$this->ipv4Address = $ipAddress["address"];
8686
}
87-
elseif(preg_match("/^[0-9a-z]{1,4}(:[0-9a-z]{0,4}){0,6}$/", $ipAddress["address"])){
87+
elseif(preg_match("/^[0-9a-z]{1,4}(:[0-9a-z]{0,4}){1,7}$/", $ipAddress["address"])){
8888
$this->ipv6Address = $ipAddress["address"];
8989
}
9090
elseif(preg_match("/^[0-9a-z]{16}\.onion$/", $ipAddress["address"])){

0 commit comments

Comments
 (0)