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 5.0.3 to 5.0.4

14

dist/synchronizer/BitcoindRelaySynchronizer.js

@@ -43,5 +43,9 @@ "use strict";

const computedHeaderMap = {};
let forkFee;
let mainFee;
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) {
if (mainFee == null)
mainFee = yield this.btcRelay.getMainFeeRate();
if (final &&

@@ -51,12 +55,16 @@ this.btcRelay.maxShortForkHeadersPerTx != null &&

this.btcRelay.saveShortForkHeaders != null) {
cacheData = yield this.btcRelay.saveShortForkHeaders(headerCache, cacheData.lastStoredHeader, tipData.chainWork);
cacheData = yield this.btcRelay.saveShortForkHeaders(headerCache, cacheData.lastStoredHeader, tipData.chainWork, mainFee);
}
else {
cacheData = yield this.btcRelay.saveNewForkHeaders(headerCache, cacheData.lastStoredHeader, tipData.chainWork);
cacheData = yield this.btcRelay.saveNewForkHeaders(headerCache, cacheData.lastStoredHeader, tipData.chainWork, mainFee);
}
}
else if (cacheData.forkId === 0) {
cacheData = yield this.btcRelay.saveMainHeaders(headerCache, cacheData.lastStoredHeader);
if (mainFee == null)
mainFee = yield this.btcRelay.getMainFeeRate();
cacheData = yield this.btcRelay.saveMainHeaders(headerCache, cacheData.lastStoredHeader, mainFee);
}
else {
if (forkFee == null)
forkFee = yield this.btcRelay.getForkFeeRate(cacheData.forkId);
cacheData = yield this.btcRelay.saveForkHeaders(headerCache, cacheData.lastStoredHeader, cacheData.forkId, tipData.chainWork);

@@ -63,0 +71,0 @@ }

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

@@ -29,3 +29,3 @@ "main": "./dist/index.js",

"bn.js": "5.2.1",
"crosslightning-base": "6.0.1"
"crosslightning-base": "6.0.2"
},

@@ -32,0 +32,0 @@ "devDependencies": {

@@ -62,5 +62,9 @@

let forkFee: string;
let mainFee: string;
const saveHeaders = async (headerCache: BitcoindBlock[], final: boolean) => {
console.log("[BtcRelaySynchronizer]: Header cache: ", headerCache.map(e => e.hash));
if(cacheData.forkId===-1) {
if(mainFee==null) mainFee = await this.btcRelay.getMainFeeRate();
if(

@@ -72,10 +76,12 @@ final &&

) {
cacheData = await this.btcRelay.saveShortForkHeaders(headerCache, cacheData.lastStoredHeader, tipData.chainWork);
cacheData = await this.btcRelay.saveShortForkHeaders(headerCache, cacheData.lastStoredHeader, tipData.chainWork, mainFee);
} else {
cacheData = await this.btcRelay.saveNewForkHeaders(headerCache, cacheData.lastStoredHeader, tipData.chainWork);
cacheData = await this.btcRelay.saveNewForkHeaders(headerCache, cacheData.lastStoredHeader, tipData.chainWork, mainFee);
}
} else if(cacheData.forkId===0) {
cacheData = await this.btcRelay.saveMainHeaders(headerCache, cacheData.lastStoredHeader);
if(mainFee==null) mainFee = await this.btcRelay.getMainFeeRate();
cacheData = await this.btcRelay.saveMainHeaders(headerCache, cacheData.lastStoredHeader, mainFee);
} else {
cacheData = await this.btcRelay.saveForkHeaders(headerCache, cacheData.lastStoredHeader, cacheData.forkId, tipData.chainWork)
if(forkFee==null) forkFee = await this.btcRelay.getForkFeeRate(cacheData.forkId);
cacheData = await this.btcRelay.saveForkHeaders(headerCache, cacheData.lastStoredHeader, cacheData.forkId, tipData.chainWork);
}

@@ -82,0 +88,0 @@ if(cacheData.forkId!==-1 && cacheData.forkId!==0) startForkId = cacheData.forkId;

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