Commit 8ecfb511 authored by Cédric Moreau's avatar Cédric Moreau

Merge branch 'fix/blockCount'

parents 590dd993 fce39279
Pipeline #8719 passed with stage
in 31 seconds
......@@ -35,7 +35,7 @@ module.exports = async (req: any, res: any, next: any) => {
// detect fork
if ( blockchain.length > 0 )
{
let newHashPreviousCurrentblock = (await dataFinder.getBlock(blockchain.length - 1) as { hash: string }).hash
let newHashPreviousCurrentblock = (await dataFinder.getCurrentBlockOrNull() as { hash: string }).hash
if ( hashPreviousCurrentblock != newHashPreviousCurrentblock )
{
blockchain.splice(0, blockchain.length);
......@@ -65,7 +65,7 @@ module.exports = async (req: any, res: any, next: any) => {
}
// stock hashPreviousCurrentblock and previousBlockchainTime
let tmpCurrentBlock = await dataFinder.getBlock(blockchain.length - 1) as DBBlock
let tmpCurrentBlock = await dataFinder.getCurrentBlockOrNull() as DBBlock
hashPreviousCurrentblock = tmpCurrentBlock.hash;
previousBlockchainTime = tmpCurrentBlock.medianTime;
......
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