Skip to content

Commit

Permalink
fix index; getlasttxs; enable getpeerinfo;
Browse files Browse the repository at this point in the history
  • Loading branch information
iquidus committed Jul 17, 2016
1 parent fb1821d commit 3e9feb1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app.js
Expand Up @@ -17,7 +17,7 @@ var app = express();
bitcoinapi.setWalletDetails(settings.wallet);
if (settings.heavy != true) {
bitcoinapi.setAccess('only', ['getinfo', 'getnetworkhashps', 'getmininginfo','getdifficulty', 'getconnectioncount',
'getblockcount', 'getblockhash', 'getblock', 'getrawtransaction']);
'getblockcount', 'getblockhash', 'getblock', 'getrawtransaction', 'getpeerinfo']);
} else {
// enable additional heavy api calls
/*
Expand Down Expand Up @@ -93,8 +93,8 @@ app.use('/ext/getdistribution', function(req,res){
});
});

app.use('/ext/getlasttxs', function(req,res){
db.get_last_txs(settings.index.last_txs, (settings.movement.min_amount * 100000000), function(txs){
app.use('/ext/getlasttxs/:min', function(req,res){
db.get_last_txs(settings.index.last_txs, (req.params.min * 100000000), function(txs){
res.send({data: txs});
});
});
Expand Down
2 changes: 1 addition & 1 deletion routes/index.js
Expand Up @@ -184,7 +184,7 @@ router.get('/richlist', function(req, res) {
});

router.get('/movement', function(req, res) {
res.render('movement', {active: 'movement', flaga: settings.movement.low_flag, flagb: settings.movement.high_flag});
res.render('movement', {active: 'movement', flaga: settings.movement.low_flag, flagb: settings.movement.high_flag, min_amount:settings.movement.min_amount});
});

router.get('/reward', function(req, res){
Expand Down
2 changes: 1 addition & 1 deletion views/index.jade
Expand Up @@ -37,7 +37,7 @@ block content
lengthChange: true,
processing: true,
ajax: {
url: '/ext/getlasttxs/#{settings.index.last_txs}/0.00000001',
url: '/ext/getlasttxs/0.00000001',
dataSrc: function ( json ) {
for ( var i=0;i<json.data.length; i++ ) {
json.data[i]['timestamp'] = new Date((json.data[i]['timestamp']) * 1000).toUTCString();
Expand Down
2 changes: 1 addition & 1 deletion views/movement.jade
Expand Up @@ -38,7 +38,7 @@ block content
lengthChange: false,
//processing: true,
ajax: {
url: '/ext/getlasttxs',
url: '/ext/getlasttxs/#{min_amount}',
dataSrc: function ( json ) {
for ( var i=0;i<json.data.length; i++ ) {
json.data[i]['timestamp'] = format_unixtime(json.data[i]['timestamp']);
Expand Down

0 comments on commit 3e9feb1

Please sign in to comment.