fix bad return for addr txs.

This commit is contained in:
Christopher Jeffrey 2014-11-19 15:56:14 -08:00
parent 61856ab68d
commit 7767bdd828
1 changed files with 6 additions and 0 deletions

View File

@ -436,6 +436,12 @@ Bitcoin.prototype.getAddrTransactions = function(addr, callback) {
return bitcoindjs.getAddrTransactions(addr, function(err, addr) {
if (err) return callback(err);
addr = bitcoin.addr(addr);
if (!addr.tx[0].out[0]) {
return callback(null, bitcoin.addr({
address: addr.address,
tx: []
}));
}
Bitcoin._addrCache[addr.address] = {
addr: addr,
time: Date.now()