Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name pool #614

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
136514b
Digibyte
esotericizm Jan 13, 2015
a08f38c
DGB Support via coinmarketcap API
esotericizm Feb 3, 2015
9526943
Remove Specific COmmit
Aug 17, 2015
360e2dc
Update package.json
esotericizm Apr 15, 2016
1cf2701
Display Algo Type
Jun 13, 2016
f0970b7
Comma Display Algo
Jun 13, 2016
6be7b47
dgbholdings
Apr 15, 2017
1a94a64
Update Pools
Apr 15, 2017
6c947f2
update scriptpubkey & tx sorting
keekade Jul 4, 2017
069de0a
update bitcore dependency
Sep 4, 2018
80758b1
update testnet rpcport
Sep 4, 2018
a069d6e
lock winston version
Sep 4, 2018
66a8a9f
update bitcore dependency
Sep 5, 2018
f032e2c
update bitcore dependency again
Sep 5, 2018
d1db45b
March 2019 Updated Miner Coinbase Flags
digibyte Mar 23, 2019
7274734
DigiByte
digibyte Mar 29, 2019
e2ebee7
update bitcore dep
Mar 31, 2019
de4a42b
Update bitcore again
Mar 31, 2019
4229249
call getnetworkinfo along with getblockchaininfo
Apr 1, 2019
43221ca
update bitcore
Apr 1, 2019
f5b0f96
Update bitcore again
Apr 2, 2019
517988f
Testnet Port changes
digibyte Apr 4, 2019
54e04d7
Added a bunch from dgbwiki Pools
ChillingSilence May 24, 2019
e90d5c7
Fixed IceMining.ca string
ChillingSilence May 24, 2019
9784c39
Fixed the missing bracket on all new submissions
ChillingSilence May 24, 2019
fbb5961
Try-Catch block to catch scripts that contain no addresses, such as o…
SmartArray Jul 6, 2019
a5428b0
Merge pull request #1 from ChillingSilence/master
Jul 23, 2019
6e02d72
Merge pull request #2 from SmartArray/master
Jul 23, 2019
fad55f7
use async 0.9.2
Jul 28, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions app/controllers/addresses.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ var Address = require('../models/Address');
var common = require('./common');
var async = require('async');

var RPC_CONCURRENCY = 5;

var tDb = require('../../lib/TransactionDb').default();

var getAddr = function(req, res, next) {
Expand Down Expand Up @@ -101,7 +103,7 @@ exports.multitxs = function(req, res, next) {

if (paginated) {
txs.sort(function(a, b) {
return (b.ts || b.ts) - (a.ts || a.ts);
return (b.firstSeenTs || b.ts) - (a.firstSeenTs || a.ts);
});
var start = Math.max(from || 0, 0);
var end = Math.min(to || txs.length, txs.length);
Expand All @@ -111,10 +113,15 @@ exports.multitxs = function(req, res, next) {
var txIndex = {};
_.each(txs, function (tx) { txIndex[tx.txid] = tx; });

async.each(txs, function (tx, callback) {
tDb.fromIdWithInfo(tx.txid, function(err, tx) {
async.eachLimit(txs, RPC_CONCURRENCY, function(tx2, callback) {
tDb.fromIdWithInfo(tx2.txid, function(err, tx) {
if (err) console.log(err);
if (tx && tx.info) {

if (tx2.firstSeenTs)
tx.info.firstSeenTs = tx2.firstSeenTs;


txIndex[tx.txid].info = tx.info;
}
callback();
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ exports.list = function(req, res) {
hash: b.hash,
time: b.ts || info.time,
txlength: info.tx.length,
poolInfo: info.poolInfo
poolInfo: info.poolInfo,
algo: info.pow_algo
});
});
}, function(err, allblocks) {
Expand Down
12 changes: 6 additions & 6 deletions app/controllers/currency.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var config = require('../../config/config');
// Set the initial vars
var timestamp = +new Date(),
delay = config.currencyRefresh * 60000,
bitstampRate = 0;
usdRate = 0;

exports.index = function(req, res) {

Expand Down Expand Up @@ -40,21 +40,21 @@ exports.index = function(req, res) {

// Init
var currentTime = +new Date();
if (bitstampRate === 0 || currentTime >= (timestamp + delay)) {
if (usdRate === 0 || currentTime >= (timestamp + delay)) {
timestamp = currentTime;

_request('https://www.bitstamp.net/api/ticker/', function(err, data) {
if (!err) bitstampRate = parseFloat(JSON.parse(data).last);
_request('http://coinmarketcap-nexuist.rhcloud.com/api/dgb', function(err, data) {
if (!err) usdRate = parseFloat(JSON.parse(data).price.usd);

res.jsonp({
status: 200,
data: { bitstamp: bitstampRate }
data: { bitstamp: usdRate }
});
});
} else {
res.jsonp({
status: 200,
data: { bitstamp: bitstampRate }
data: { bitstamp: usdRate }
});
}
};
7 changes: 4 additions & 3 deletions app/models/Address.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var imports = require('soop').imports();
var _ = require('lodash');
var async = require('async');
var bitcore = require('bitcore');
var BitcoreAddress = bitcore.Address;
Expand Down Expand Up @@ -112,7 +113,7 @@ Address.prototype._addTxItem = function(txItem, txList, includeInfo) {
seen[txItem.txid] = 1;
add = 1;

addTx({ txid: txItem.txid, ts: txItem.ts });
addTx({ txid: txItem.txid, ts: txItem.ts, firstSeenTs: txItem.firstSeenTs });
}

// Spent tx
Expand Down Expand Up @@ -178,7 +179,7 @@ Address.prototype.update = function(next, opts) {
return !x.spentTxId;
});
tDb.fillScriptPubKey(txOut, function() {
self.unspent = txOut.map(function(x){
self.unspent = _.filter(txOut.map(function(x) {
return {
address: self.addrStr,
txid: x.txid,
Expand All @@ -189,7 +190,7 @@ Address.prototype.update = function(next, opts) {
confirmations: x.isConfirmedCached ? (config.safeConfirmations) : x.confirmations,
confirmationsFromCache: !!x.isConfirmedCached,
};
});
}), 'scriptPubKey');
return next();
});
}
Expand Down
10 changes: 9 additions & 1 deletion app/models/Status.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,28 @@ var RpcClient = bitcore.RpcClient;
var config = require('../../config/config');
var rpc = new RpcClient(config.bitcoind);
var bDb = require('../../lib/BlockDb').default();
var _ = require('lodash');

function Status() {}


Status.prototype.getInfo = function(next) {
var that = this;
async.series([
function (cb) {
rpc.getInfo(function(err, info){
rpc.getBlockchainInfo(function(err, info){
if (err) return cb(err);

that.info = info.result;
return cb();
});
},
function (cb) {
rpc.getNetworkInfo(function(err, info) {
_.extend(that.info, _.extend(info.result));
return cb();
})
}
], function (err) {
return next(err);
});
Expand Down
14 changes: 7 additions & 7 deletions config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ if (process.env.INSIGHT_NETWORK === 'livenet') {
env = 'livenet';
db = home;
port = '3000';
b_port = '8332';
p2p_port = '8333';
b_port = '14022';
p2p_port = '12024';
} else {
env = 'testnet';
db = home + '/testnet';
port = '3001';
b_port = '18332';
p2p_port = '18333';
b_port = '14023';
p2p_port = '12026';
}
port = parseInt(process.env.INSIGHT_PORT) || port;

Expand All @@ -56,9 +56,9 @@ var isWin = /^win/.test(process.platform);
var isMac = /^darwin/.test(process.platform);
var isLinux = /^linux/.test(process.platform);
if (!dataDir) {
if (isWin) dataDir = '%APPDATA%\\Bitcoin\\';
if (isMac) dataDir = process.env.HOME + '/Library/Application Support/Bitcoin/';
if (isLinux) dataDir = process.env.HOME + '/.bitcoin/';
if (isWin) dataDir = '%APPDATA%\\Digibyte\\';
if (isMac) dataDir = process.env.HOME + '/Library/Application Support/Digibyte/';
if (isLinux) dataDir = process.env.HOME + '/.digibyte/';
}
dataDir += network === 'testnet' ? 'testnet3' : '';

Expand Down
Loading