Skip to content
Snippets Groups Projects
Commit ef141c7a authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[fix] stats API will change with Duniter 1.8

parent c882eccf
No related branches found
No related tags found
No related merge requests found
......@@ -759,7 +759,8 @@ function getLAN(family) {
async function getLastBlockWithDividend(server) {
// server.dal.blockDAL.lastBlockWithDividend() is deprectated (too expensive)
let stat = await server.dal.getStat('ud');
return server.dal.getBlock(stat.blocks.pop())
const blockNumbers = stat.blocks || stat // stat.blocks = Duniter v1.7.x, stat = Duniter 1.8.x
return server.dal.getBlock(blockNumbers.pop())
}
util.inherits(WebAdmin, stream.Duplex);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment