diff --git a/model/ip.php b/model/ip.php index 8328192..58d3807 100644 --- a/model/ip.php +++ b/model/ip.php @@ -82,7 +82,18 @@ class ModelIp extends Model { } } - public function addOnline($ipId, $startingHeight, $timeConnection, $timeLastSend, $timeLastReceive) { + public function addOnline($ipId, + $startingHeight, + $timeConnection, + $timeLastSend, + $timeLastReceive, + $bytesSent, + $bytesReceive, + $banscore, + $inbound, + $version, + $subVersion, + $syncNode) { try { @@ -91,10 +102,28 @@ class ModelIp extends Model { `timeConnection` = ?, `timeLastSend` = ?, `timeLastReceive` = ?, + `bytesSent` = ?, + `bytesReceive` = ?, + `banscore` = ?, + `inbound` = ?, + `version` = ?, + `subVersion` = ?, + `syncNode` = ?, `timeAdded` = UNIX_TIMESTAMP()'); - $query->execute([$ipId, $startingHeight, $timeConnection, $timeLastSend, $timeLastReceive]); + $query->execute([ $ipId, + $startingHeight, + $timeConnection, + $timeLastSend, + $timeLastReceive, + $bytesSent, + $bytesReceive, + $banscore, + $inbound, + $version, + $subVersion, + $syncNode]); return $this->db->lastInsertId(); diff --git a/peer.php b/peer.php index a99775d..999cced 100644 --- a/peer.php +++ b/peer.php @@ -83,10 +83,17 @@ if ($peers = $curlPeer->getAll()) { // Update online time $modelIp->addOnline($ipId, - $peer['startingheight'], - $peer['conntime'], - $peer['lastsend'], - $peer['lastrecv']); + (int) $peer['startingheight'], + (int) $peer['conntime'], + (int) $peer['lastsend'], + (int) $peer['lastrecv'], + (int) $peer['bytessent'], + (int) $peer['bytesrecv'], + (int) $peer['banscore'], + (int) $peer['inbound'], + (int) $peer['version'], + preg_replace('/[^\d]/', '', $peer['subver']), + (isset($peer['syncnode']) ? (int) $peer['syncnode'] : 0)); } else { $modelLog->add(_('Could not extract peer address or port')); }