Skip to content
Permalink
Browse files

Merge pull request #729 from pinheadmz/backend

Quit if native bcrypto bindings are missing
  • Loading branch information
braydonf committed Oct 31, 2019
2 parents f991b0a + d553f0a commit 77d88042aa383b06fd0eab7ad61678343e77b1ff
Showing with 34 additions and 0 deletions.
  1. +17 −0 bin/node
  2. +17 −0 bin/spvnode
@@ -19,6 +19,23 @@ if (process.argv.indexOf('--version') !== -1
throw new Error('Could not exit.');
}

const sha256 = require('bcrypto/lib/sha256');
const secp256k1 = require('bcrypto/lib/secp256k1');

if (sha256.native !== 2) {
console.error('Bindings for bcrypto were not built.');
console.error('Please build them before continuing.');
process.exit(1);
return;
}

if (secp256k1.native !== 2) {
console.error('Bindings for libsecp256k1 were not built.');
console.error('Please build them before continuing.');
process.exit(1);
return;
}

const FullNode = require('../lib/node/fullnode');

const node = new FullNode({
@@ -8,6 +8,23 @@ const assert = require('assert');
const SPVNode = require('../lib/node/spvnode');
const Outpoint = require('../lib/primitives/outpoint');

const sha256 = require('bcrypto/lib/sha256');
const secp256k1 = require('bcrypto/lib/secp256k1');

if (sha256.native !== 2) {
console.error('Bindings for bcrypto were not built.');
console.error('Please build them before continuing.');
process.exit(1);
return;
}

if (secp256k1.native !== 2) {
console.error('Bindings for libsecp256k1 were not built.');
console.error('Please build them before continuing.');
process.exit(1);
return;
}

const node = new SPVNode({
file: true,
argv: true,

0 comments on commit 77d8804

Please sign in to comment.
You can’t perform that action at this time.