fix bcmonitor startup
This commit is contained in:
parent
d5bcb182d6
commit
2f93137767
|
@ -223,7 +223,7 @@ BlockchainMonitor.prototype._updateAddressesWithBalance = function(address, cb)
|
||||||
}
|
}
|
||||||
|
|
||||||
addresses.push(address.address);
|
addresses.push(address.address);
|
||||||
log.info('Activating address '+address);
|
log.info('Activating address ' + address.address);
|
||||||
self.storage.storeAddressesWithBalance(address.walletId, addresses, function(err) {
|
self.storage.storeAddressesWithBalance(address.walletId, addresses, function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
log.warn('Could not update wallet cache', err);
|
log.warn('Could not update wallet cache', err);
|
||||||
|
|
|
@ -228,6 +228,7 @@ Storage.prototype._completeTxData = function(walletId, txs, cb) {
|
||||||
// TODO: remove walletId from signature
|
// TODO: remove walletId from signature
|
||||||
Storage.prototype.fetchTx = function(walletId, txProposalId, cb) {
|
Storage.prototype.fetchTx = function(walletId, txProposalId, cb) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
if (!this.db) return cb();
|
||||||
|
|
||||||
this.db.collection(collections.TXS).findOne({
|
this.db.collection(collections.TXS).findOne({
|
||||||
id: txProposalId,
|
id: txProposalId,
|
||||||
|
@ -241,6 +242,7 @@ Storage.prototype.fetchTx = function(walletId, txProposalId, cb) {
|
||||||
|
|
||||||
Storage.prototype.fetchTxByHash = function(hash, cb) {
|
Storage.prototype.fetchTxByHash = function(hash, cb) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
if (!this.db) return;
|
||||||
|
|
||||||
this.db.collection(collections.TXS).findOne({
|
this.db.collection(collections.TXS).findOne({
|
||||||
txid: hash,
|
txid: hash,
|
||||||
|
@ -542,6 +544,7 @@ Storage.prototype.fetchAddressByWalletId = function(walletId, address, cb) {
|
||||||
|
|
||||||
Storage.prototype.fetchAddressByCoin = function(coin, address, cb) {
|
Storage.prototype.fetchAddressByCoin = function(coin, address, cb) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
if (!this.db) return cb();
|
||||||
|
|
||||||
this.db.collection(collections.ADDRESSES).find({
|
this.db.collection(collections.ADDRESSES).find({
|
||||||
address: address,
|
address: address,
|
||||||
|
|
Loading…
Reference in New Issue