Adding function to delete cache for a given addr

Adding _deleteCache: deletes the cache for given address (useful for dev purposes or to recalculate caches)
This commit is contained in:
sairajzero 2023-04-19 02:31:04 +05:30
parent 4d023760ad
commit 6beb2ecd06

View File

@ -495,6 +495,17 @@ AddressService.prototype._loadCache = function(address, result, useCache, next)
});
}
AddressService.prototype._deleteCache = function(address, callback) {
const self = this;
var key = self._encoding.encodeAddressCacheKey(address);
if(!_.isFunction(callback)) //if callback is not passed, call a empty function
callback = () => null;
self._db.del(key, callback);
}
AddressService.prototype._setOutputResults = function(tx, address, result) {
for(var j = 0; j < tx.outputs.length; j++) {