New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@dashevo/dash-spv

Package Overview
Dependencies
Maintainers
7
Versions
266
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dashevo/dash-spv - npm Package Compare versions

Comparing version 1.1.7-5 to 1.1.7

1

lib/blockstore.js

@@ -56,2 +56,3 @@ const levelup = require('levelup');

module.exports = BlockStore;

6

lib/consensus.js

@@ -9,3 +9,3 @@ const { hasValidTarget } = require('@dashevo/dark-gravity-wave');

function getMedianTimestamp(headers) {
const timestamps = headers.map((h) => h.time);
const timestamps = headers.map(h => h.time);
const median = (arr) => {

@@ -26,3 +26,3 @@ const mid = Math.floor(arr.length / 2);

Math.max(previousHeaders.length - MIN_TIMESTAMP_HEADERS, 0),
).map((h) => utils.normalizeHeader(h));
).map(h => utils.normalizeHeader(h));
return getMedianTimestamp(normalizedLatestHeaders) < headerNormalised.time;

@@ -37,3 +37,3 @@ }

&& hasValidTarget(
utils.getDgwBlock(newHeader), previousHeaders.map((h) => utils.getDgwBlock(h)), network,
utils.getDgwBlock(newHeader), previousHeaders.map(h => utils.getDgwBlock(h)), network,
);

@@ -40,0 +40,0 @@ }

@@ -14,6 +14,6 @@ const DashUtil = require('@dashevo/dash-util');

if (typeof transactions[0] === 'string') {
txToFilter = txToFilter.map((tx) => DashUtil.toHash(tx).toString('hex'));
txToFilter = txToFilter.map(tx => DashUtil.toHash(tx).toString('hex'));
}
return merkleBlock.validMerkleTree
&& txToFilter.filter((tx) => merkleBlock.hasTransaction(tx)).length === transactions.length;
&& txToFilter.filter(tx => merkleBlock.hasTransaction(tx)).length === transactions.length;
},

@@ -20,0 +20,0 @@ };

const BlockStore = require('./blockstore');
const config = require('../config/config');
const Consensus = require('./consensus');
const utils = require('./utils');
const utils = require('../lib/utils');

@@ -133,5 +133,5 @@ const SpvChain = class {

isDuplicate(compareHash) {
return this.getAllBranches().map((branch) => branch.map((node) => node.hash))
.concat(this.orphanBlocks.map((orphan) => orphan.hash))
.filter((hash) => hash === compareHash).length > 0;
return this.getAllBranches().map(branch => branch.map(node => node.hash))
.concat(this.orphanBlocks.map(orphan => orphan.hash))
.filter(hash => hash === compareHash).length > 0;
}

@@ -258,3 +258,3 @@

return this.getLongestChain().filter((h) => h.hash === hash)[0];
return this.getLongestChain().filter(h => h.hash === hash)[0];
});

@@ -300,3 +300,3 @@ }

}
const normalizedHeaders = headers.map((h) => utils.normalizeHeader(h));
const normalizedHeaders = headers.map(h => utils.normalizeHeader(h));
const isOrphan = !SpvChain.isParentChild(normalizedHeaders[0], this.getTipHeader());

@@ -303,0 +303,0 @@

{
"name": "@dashevo/dash-spv",
"version": "1.1.7-5",
"version": "1.1.7",
"description": "Repository containing SPV functions used by @dashevo",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -216,2 +216,2 @@ /* eslint no-underscore-dangle: ["error", { "allow": ["_getHash"] }] */

module.exports = headers.map((h) => utils.normalizeHeader(h));
module.exports = headers.map(h => utils.normalizeHeader(h));
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc