Add support for customizing all daemon api cmds

This commit is contained in:
joeuhren
2020-12-07 21:32:43 -07:00
parent c7efaad294
commit 4240178255
11 changed files with 936 additions and 440 deletions
+13 -13
View File
@@ -116,7 +116,7 @@ function find_tx(txid, cb) {
function save_tx(txid, blockheight, cb) {
lib.get_rawtransaction(txid, function(tx){
if (tx != 'There was an error. Check your console.') {
if (tx && tx != 'There was an error. Check your console.') {
lib.prepare_vin(tx, function(vin) {
lib.prepare_vout(tx.vout, txid, vin, ((typeof tx.vjoinsplit === 'undefined' || tx.vjoinsplit == null) ? [] : tx.vjoinsplit), function(vout, nvin) {
lib.syncLoop(vin.length, function (loop) {
@@ -680,14 +680,14 @@ module.exports = {
}, function(){
console.log(newVotes);
Heavy.updateOne({coin: coin}, {
lvote: vote,
reward: reward,
supply: supply,
cap: maxmoney,
estnext: estnext,
phase: phase,
maxvote: maxvote,
nextin: nextin,
lvote: (vote ? vote : 0),
reward: (reward ? reward : 0),
supply: (supply ? supply : 0),
cap: (maxmoney ? maxmoney : 0),
estnext: (estnext ? estnext : 0),
phase: (phase ? phase : 'N/A'),
maxvote: (maxvote ? maxvote : 0),
nextin: (nextin ? nextin : 'N/A'),
votes: newVotes,
}, function() {
//console.log('address updated: %s', hash);
@@ -765,8 +765,8 @@ module.exports = {
Stats.updateOne({coin: coin}, {
coin: coin,
count : count,
supply: supply,
connections: connections
supply: (supply ? supply : 0),
connections: (connections ? connections : 0)
}, function(err) {
if (err) {
console.log("Error during Stats Update: ", err);
@@ -774,8 +774,8 @@ module.exports = {
return cb({
coin: coin,
count : count,
supply: supply,
connections: connections,
supply: (supply ? supply : 0),
connections: (connections ? connections : 0),
last: (stats.last ? stats.last : 0),
txes: (stats.txes ? stats.txes : 0)
});