Added support for newer mongoose versions
-Mongoose and mongodb dependencies have been updated to the most recent versions in package.json -Updated the project for use with the newest mongoose major version which required fixing many breaking changes to a number of files in the explorer -Removed the db.find_address_tx() function as it is unused NOTE: This update requires mongoose 6.0.10 or higher. If you are getting errors running the explorer after upgrading, it is recommended to run an 'npm update' or manually update mongoose to a more modern version which should fix the problem
This commit is contained in:
+402
-303
File diff suppressed because it is too large
Load Diff
+8
-2
@@ -10,11 +10,14 @@ const client = new onode.Client(settings.wallet);
|
||||
|
||||
// returns coinbase total sent as current coin supply
|
||||
function coinbase_supply(cb) {
|
||||
Address.findOne({a_id: 'coinbase'}, function(err, address) {
|
||||
Address.findOne({a_id: 'coinbase'}).then((address) => {
|
||||
if (address)
|
||||
return cb(address.sent);
|
||||
else
|
||||
return cb(0);
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
return cb(0);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -810,7 +813,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
balance_supply: function(cb) {
|
||||
Address.find({}, 'balance').where('balance').gt(0).exec(function(err, docs) {
|
||||
Address.find({}, 'balance').where('balance').gt(0).exec().then((docs) => {
|
||||
var count = 0;
|
||||
|
||||
module.exports.syncLoop(docs.length, function (loop) {
|
||||
@@ -821,6 +824,9 @@ module.exports = {
|
||||
}, function() {
|
||||
return cb(count);
|
||||
});
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
return cb(0);
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user