1
0
mirror of https://github.com/GOSTSec/gostexplr synced 2025-09-08 04:02:21 +00:00

Address length to 35, sync blockchain nextblockhash update fix, restyling

This commit is contained in:
xcps 2018-02-05 01:10:15 +05:00
parent f3aa986c33
commit 0a86fb43a4
5 changed files with 172 additions and 158 deletions

View File

@ -102,11 +102,18 @@ async function syncNextBlock(syncedHeight) {
const block = JSON.parse(res_block)['result'];
block.time = new Date(block.time * 1000);
await models.Block.create(block);
// console.log('block:', block);
for (var i = 0; i < block.tx.length; i++) {
await saveTransaction(block.tx[i], block.height);
}
if (block.height > 1) {
await models.Block.update({
nextblockhash: block.hash
},{
where: {
hash: block.previousblockhash
}
});
}
return height;
}

View File

@ -2,7 +2,7 @@
module.exports = (sequelize, DataTypes) => {
const Address = sequelize.define('Address', {
address: DataTypes.STRING(34),
address: DataTypes.STRING(35),
}, {
timestamps: false,
indexes: [{

View File

@ -6,14 +6,7 @@ body {
font: 16px monospace;
}
.page-wrapper {
display: flex;
justify-content: center;
}
.page.absolute {
display: flex;
flex-direction: column;
.page {
}
table td {
@ -28,43 +21,44 @@ a:hover {
color: #bf5c5f;
}
.header {
overflow: hidden;
}
.header h1 a {
color: black;
text-decoration: none;
align: center;
outline: none;
}
.header h1 a img:hover {
.header .logo {
float: left;
}
.header .logo a img:hover {
filter: brightness(1.25);
}
.header h1 a img {
height: 2em;
.header .logo a img {
height: 84px;
position: relative;
margin-right: .5em;
}
.header form input[type="submit"] {
form.search input[type="submit"] {
padding: .2em .7em;
}
@-moz-document url-prefix() {
.header form input[type="submit"] {
form.search input[type="submit"] {
padding: .15em .7em;
}
}
.header form input[type="text"] {
form.search input[type="text"] {
padding: .2em;
}
.header h1 a span {
position: relative;
top: -0.5em;
}
.header h1 a span:hover {
.header h1 a:hover {
border-bottom: 3px solid;
border-bottom-color: #CF7F7F;
}

View File

@ -5,6 +5,18 @@ block content
table
each key in Object.keys(block.dataValues)
if (key === 'nextblockhash')
tr
td.capitalize #{key}
td
a(href='/block/#{block.nextblockhash}/') #{block.nextblockhash}
-continue
if (key === 'previousblockhash')
tr
td.capitalize #{key}
td
a(href='/block/#{block.previousblockhash}/') #{block.previousblockhash}
-continue
if (key === 'Transactions')
-continue
tr

View File

@ -4,16 +4,17 @@ html
title GOSTcoin blockchain explorer
link(rel='stylesheet', href='/stylesheets/style.css')
link(rel='shortcut icon', href='/favicon.ico')
meta(name="viewport", content="width=device-width")
body
div.page-wrapper
div.page
div.header
h1
div.logo
a(href='/')
img(src='/images/gostcoin-b.png')
span GOSTcoin blockchain explorer
h1
a(href='/') GOSTcoin blockchain explorer
div
form(action="/search/", method="POST")
form.search(action="/search/", method="POST")
input(type="text", name="search" placeholder="Search by transaction id, block hash/index or address", size="68")
input(type="submit", value=">>")
div.content