Give false if spent information not available.

This commit is contained in:
Braydon Fuller 2015-10-01 23:50:06 -04:00
parent 539b263c67
commit 27e90ef41a
1 changed files with 4 additions and 1 deletions

View File

@ -8,6 +8,7 @@ var log = index.log;
var errors = index.errors;
var Transaction = require('../../transaction');
var bitcore = require('bitcore');
var levelup = require('levelup');
var $ = bitcore.util.preconditions;
var _ = bitcore.deps._;
var Hash = bitcore.crypto.Hash;
@ -763,7 +764,9 @@ AddressService.prototype.getInputForOutput = function(txid, outputIndex, options
keyEncoding: 'binary'
};
this.node.services.db.store.get(key, dbOptions, function(err, buffer) {
if (err) {
if (err instanceof levelup.errors.NotFoundError) {
return callback(null, false);
} else if (err) {
return callback(err);
}
var value = self._decodeInputValueMap(buffer);