Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

btcrelay-bitcoind

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

btcrelay-bitcoind - npm Package Compare versions

Comparing version 3.0.12 to 3.1.0

16

dist/synchronizer/BitcoindRelaySynchronizer.js

@@ -42,6 +42,14 @@ "use strict";

const computedHeaderMap = {};
const saveHeaders = (headerCache) => __awaiter(this, void 0, void 0, function* () {
const saveHeaders = (headerCache, final) => __awaiter(this, void 0, void 0, function* () {
console.log("[BtcRelaySynchronizer]: Header cache: ", headerCache.map(e => e.hash));
if (cacheData.forkId === -1) {
cacheData = yield this.btcRelay.saveNewForkHeaders(headerCache, cacheData.lastStoredHeader, tipData.chainWork);
if (final &&
this.btcRelay.maxShortForkHeadersPerTx != null &&
this.btcRelay.maxShortForkHeadersPerTx >= headerCache.length &&
this.btcRelay.saveShortForkHeaders != null) {
cacheData = yield this.btcRelay.saveShortForkHeaders(headerCache, cacheData.lastStoredHeader, tipData.chainWork);
}
else {
cacheData = yield this.btcRelay.saveNewForkHeaders(headerCache, cacheData.lastStoredHeader, tipData.chainWork);
}
}

@@ -69,3 +77,3 @@ else if (cacheData.forkId === 0) {

headerCache.length >= this.btcRelay.maxForkHeadersPerTx) {
yield saveHeaders(headerCache);
yield saveHeaders(headerCache, false);
headerCache = [];

@@ -79,3 +87,3 @@ }

if (headerCache.length > 0) {
yield saveHeaders(headerCache);
yield saveHeaders(headerCache, true);
}

@@ -82,0 +90,0 @@ return {

{
"name": "btcrelay-bitcoind",
"version": "3.0.12",
"version": "3.1.0",
"description": "Connector and synchronizer using bitcoind for bitcoin relay",

@@ -25,9 +25,11 @@ "main": "./dist/index.js",

"dependencies": {
"@types/node": "^18.15.11",
"bitcoind-rpc": "^0.9.1",
"bitcoinjs-lib": "^5.2.0",
"bn.js": "^5.2.1",
"crosslightning-base": "^4.0.8",
"crosslightning-base": "^4.0.9"
},
"devDependencies": {
"@types/node": "^18.18.3",
"typescript": "^4.9.5"
}
}

@@ -59,6 +59,15 @@

const saveHeaders = async (headerCache: BitcoindBlock[]) => {
const saveHeaders = async (headerCache: BitcoindBlock[], final: boolean) => {
console.log("[BtcRelaySynchronizer]: Header cache: ", headerCache.map(e => e.hash));
if(cacheData.forkId===-1) {
cacheData = await this.btcRelay.saveNewForkHeaders(headerCache, cacheData.lastStoredHeader, tipData.chainWork)
if(
final &&
this.btcRelay.maxShortForkHeadersPerTx!=null &&
this.btcRelay.maxShortForkHeadersPerTx>=headerCache.length &&
this.btcRelay.saveShortForkHeaders!=null
) {
cacheData = await this.btcRelay.saveShortForkHeaders(headerCache, cacheData.lastStoredHeader, tipData.chainWork);
} else {
cacheData = await this.btcRelay.saveNewForkHeaders(headerCache, cacheData.lastStoredHeader, tipData.chainWork);
}
} else if(cacheData.forkId===0) {

@@ -91,3 +100,3 @@ cacheData = await this.btcRelay.saveMainHeaders(headerCache, cacheData.lastStoredHeader);

await saveHeaders(headerCache);
await saveHeaders(headerCache, false);

@@ -105,3 +114,3 @@ headerCache = [];

if(headerCache.length>0) {
await saveHeaders(headerCache);
await saveHeaders(headerCache, true);
}

@@ -108,0 +117,0 @@

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