Commit 7251e5c2 authored by Gampe Sebastian's avatar Gampe Sebastian

bug fixes

parent a8bfa0a3
# FairCoin Blockchain LiveStats
# FairCoin Blockchain Live Monitor and Statistics
### V1.0-beta
This version is the first beta-release of the tool.
It can happen that the tool is not up-to-date all the time because of updates or network tests and improvements.
Check the timestamp of the block and you will see if the tool is up-to-date and working at this moment.
The tool starts on block 335000. The complete blockchain will added soon.
## Features
* new blocks will updated on website automatically
* unconfirmed ( Mempool ) transactions will shown with a delay of max. 20 seconds )
* floating updated live statistics of daily count and amount of transactions
* different colors for addresses to differ between change and payment addresses.
* link to selection of blocks possible to share it
## Security advices
The blockchain data will get from faircoin client and processed by webscripts.
Bugs can cause wrong results on website. So the informations can't be guaranteed.
What means it for the user and usage of this tool?
For transactions with higher amounts it is recommend to double-check it also in the official blockchain explorer https://chain.fair.to
For medium amounts it is recommend to wait for the confirmation.
For small amounts it should be secure enough when the transaction is shown in the mempool ( unconfirmed ) on top of the explorer website.
......@@ -136,6 +136,14 @@ label.with-label {
color:goldenrod;
}
#versioninfo {
position: fixed;
right:1rem;
bottom:0rem;
color:goldenrod;
z-index: 101;
}
addresses
@media print, screen and (max-width: 1060px) {
......
......@@ -214,7 +214,7 @@ function TxMempool(Tx, txid, new_block=false){
var tmp='';
tmp+=' <div class="row'+((new_block) ? ' new-block' : '')+' fade-in tx'+txid+'" alt="'+txid+'">';
tmp+=' <div class="col">';
tmp+=' <div class="col txid">';
tmp+=' <button type="button" class="btn btn-outline-info btn-sm no-cursor" title="transaction-id\n\n[click to copy!]">'+txid+'</button>';
tmp+=JSON.stringify( new Date(Tx.time*1000)).slice(1,20).replace(/T/g,' ');
tmp+=' </div>';
......@@ -222,8 +222,10 @@ function TxMempool(Tx, txid, new_block=false){
tmp+=' <div class="row">';
Tx.vout.forEach(
function(w,j){
tmp+=' <div class="row addresses">';
tmp+=' <button type="button" class="btn btn-outline-'+((w.is_change) ? 'secondary' : 'light' )+' btn-sm no-cursor" title="faircoin address\n\n[click to copy!]">'+w.addresses[0]+'</button>';
tmp+=' <button type="button" class="btn btn-outline-'+((w.is_change) ? 'secondary' : 'light' )+' btn-sm fair-amount no-cursor" title="faircoin amount\n\n[click to copy!]" alt="'+w.value+'">'+w.value.toFixed(6)+' FAIR</button><br>';
tmp+=' </div>';
}
);
tmp+=' </div>';
......@@ -278,8 +280,9 @@ function loadData(blockheight, reset=true ){
if( BLOCKHEIGHT_CURRENT < blockheight && BLOCKHEIGHT_UPDATE ) blockheight=BLOCKHEIGHT_CURRENT;
var blockfile=parseInt(blockheight/1000)*1000;
var TXS=BLOCKS.txs;
$.extend(BLOCKS, content_load('data/blocks/'+blockfile+'.json','json') );
$.extend(BLOCKS.txs, TXS);
if( reset ) $('#transactions').html('');
var B=[];
......@@ -331,10 +334,9 @@ function calculateLiveStats(blockheight){
var am24h=0;
while(BLOCKS[i].time > endtime){
tx24h+=BLOCKS[i].tx.length-1;
BLOCKS[i].tx.slice(1).forEach(
function(v,i){
BLOCKS['txs'][v].vout.forEach(
function(z,k){
BLOCKS['txs'][z].vout.forEach(
function(w,j){
if(w.is_change != 1 ){
am24h+=w.value;
......@@ -366,7 +368,7 @@ function updateData(){
$('.new-block').toggleClass('new-block',false);
},500
);
calculateLiveStats(blockheight);
calculateLiveStats(BLOCKHEIGHT_CURRENT);
}
updateMempool(true);
......
<?php
?>
<!DOCTYPE html>
<html lang="de">
<head>
<title>FairCoin Statistics Explorer
<title>FairCoin Blockchain Live Monitor and Statistics
</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
......@@ -37,6 +35,7 @@
</div>
</div>
<button id="singlemode" class="btn btn-sm">singlemode</button>
<h5 id="versioninfo"><a href="https://git.fairkom.net/FairCoin/faircoin-blockchain-livestats/blob/master/README.md">V1.0-beta</a></h5>
<div class='container-fluid'>
<div class='row'>
<div class='col'>
......@@ -57,13 +56,6 @@
<script src="assets/bootstrap/bootstrap.bundle.min.js"></script>
<script src="assets/js/json.js"></script>
<script src="assets/js/script.js"></script>
<script>
</script>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment