Fixing recently sent txs.

This commit is contained in:
Chris Kleeschulte 2017-10-04 08:33:13 -04:00
parent d3515e12c9
commit b6b730ea2a
No known key found for this signature in database
GPG Key ID: 33195D27EF6BDB7F
3 changed files with 8 additions and 8 deletions

View File

@ -163,7 +163,6 @@ AddressController.prototype.multiutxo = function(req, res) {
} else {
addresses = req.addrs.split(',');
}
async.eachLimit(addresses, 4, function(addr, next) {
self._address.getAddressUnspentOutputs(addr, {}, function(err, utxos) {
@ -220,6 +219,7 @@ AddressController.prototype._getTransformOptions = function(req) {
AddressController.prototype.multitxs = function(req, res) {
var self = this;
console.log(req.body);
var options = {
from: parseInt(req.query.from) || parseInt(req.body.from) || 0
};
@ -238,12 +238,15 @@ AddressController.prototype.multitxs = function(req, res) {
if (err) {
return self.common.handleErrors(err, res);
}
res.jsonp({
var ret = {
totalItems: result.totalCount,
from: options.from,
to: Math.min(options.to, result.totalCount),
items: items
});
};
res.jsonp(ret);
});
});

View File

@ -14,6 +14,7 @@ function TxController(node) {
this._block = this.node.services.block;
this._transaction = this.node.services.transaction;
this._address = this.node.services.address;
this._p2p = this.node.services.p2p;
this._network = this.node.network;
if (this.node.network === 'livenet') {
this._network = 'main';
@ -324,7 +325,7 @@ TxController.prototype.list = function(req, res) {
TxController.prototype.send = function(req, res) {
var self = this;
this._transaction.sendTransaction(req.body.rawtx, function(err, txid) {
this._p2p.sendTransaction(req.body.rawtx, function(err, txid) {
if(err) {
// TODO handle specific errors
return self.common.handleErrors(err, res);

View File

@ -45,10 +45,6 @@ var SimpleMap = function SimpleMap() {
this.size = 0;
this.length = 0;
this.hasNullItems = function() {
return array.length !== _.compact(array).length;
};
this.remove = function(item) {
var index = object[item];
if (index) {