diff --git a/server/controllers/BlockchainBlock.ts b/server/controllers/BlockchainBlock.ts index 072276c..46ff1d7 100644 --- a/server/controllers/BlockchainBlock.ts +++ b/server/controllers/BlockchainBlock.ts @@ -23,7 +23,23 @@ import { import { Paginate } from '../utils'; var moment = require('moment'); - +moment.updateLocale('en', { + relativeTime: { + future: "in %s", + past: "%s ago", + s: "seconds", + m: "1 minute", + mm: "%d minutes", + h: "1 hour", + hh: "%d hours", + d: "1 day", + dd: "%d days", + M: "1 month", + MM: "%d months", + y: "1 year", + yy: "%d years" + } +}); export class BlockchainBlockController { public path = '/blockchain_block'; public router = express.Router(); @@ -1222,6 +1238,11 @@ export class BlockchainBlockController { var Maxrange = Math.max.apply(Math, TotalDifficultyNBlockQuery.map(function(o) { return o.tarket_difficulty; })); var Minrange = Math.min.apply(Math, TotalDifficultyNBlockQuery.map(function(o) { return o.tarket_difficulty; })); + if(Minrange != 0){ + Minrange = (Minrange - (Minrange * 0.2)); + } + Maxrange = (Maxrange + (Maxrange * 0.2)); + // Minrange = parseInt(Minrange); // var Minrange2 = parseInt(Minrange * 0.3); response.status(200).json({ @@ -1234,7 +1255,7 @@ export class BlockchainBlockController { // DifficultyCuckatoo: DifficultyCuckatoo, // DifficultyProgpow: DifficultyProgpow, Maxrange: Maxrange, - Minrange: (Minrange * 0.2), + Minrange: Minrange, TargetDifficulty: TargetDifficulty, tickFormat: tickFormat }, diff --git a/server/socket/block.ts b/server/socket/block.ts index 332b291..bd654bc 100644 --- a/server/socket/block.ts +++ b/server/socket/block.ts @@ -1,5 +1,22 @@ import { getConnection } from "typeorm"; -const moment = require("moment"); +var moment = require("moment"); +moment.updateLocale('en', { + relativeTime: { + future: "in %s", + past: "%s ago", + s: "seconds", + m: "1 minute", + mm: "%d minutes", + h: "1 hour", + hh: "%d hours", + d: "1 day", + dd: "%d days", + M: "1 month", + MM: "%d months", + y: "1 year", + yy: "%d years" + } +}); export async function universalGetLatestBlockDetails(socket) { @@ -200,6 +217,7 @@ export async function universalGetLatestBlockDetails(socket) { input_count: BlockchainLatestBlockQuery[0].input_count, kernel_count: BlockchainLatestBlockQuery[0].kernel_count, output_count: BlockchainLatestBlockQuery[0].output_count, + hash: BlockchainLatestBlockQuery[0].hash, proof: BlockchainLatestBlockQuery[0].proof, hasharray: hasharray, Difficulty: Difficulty, diff --git a/src/app/view/home/block-append/block-append.component.ts b/src/app/view/home/block-append/block-append.component.ts index d6bd93d..4abb9a2 100644 --- a/src/app/view/home/block-append/block-append.component.ts +++ b/src/app/view/home/block-append/block-append.component.ts @@ -12,7 +12,7 @@ export class BlockAppendComponent implements OnInit { constructor() {} ngOnInit() { - console.log(this.blockdetails); + //console.log(this.blockdetails); } public onClickPlus(height) { diff --git a/src/app/view/home/block-detail-list/block-detail-list.component.ts b/src/app/view/home/block-detail-list/block-detail-list.component.ts index 74cffe6..5cd7d21 100644 --- a/src/app/view/home/block-detail-list/block-detail-list.component.ts +++ b/src/app/view/home/block-detail-list/block-detail-list.component.ts @@ -31,7 +31,7 @@ export class BlockDetailListComponent implements OnInit { ngOnInit() { this.gettinglatesthashList(); this.getBlockDetails(); - console.log("Enter Nginit"); + //console.log("Enter Nginit"); } diff --git a/src/app/view/home/graph-list/graph-list.component.html b/src/app/view/home/graph-list/graph-list.component.html index 00dfa2c..f6d2e39 100644 --- a/src/app/view/home/graph-list/graph-list.component.html +++ b/src/app/view/home/graph-list/graph-list.component.html @@ -305,7 +305,7 @@ -