Bug fix
- Fixed: lastItem give tx details instead of txid
This commit is contained in:
parent
20eb50b281
commit
49356ef46c
@ -316,9 +316,12 @@ AddressController.prototype.multitxs = function(req, res) {
|
|||||||
return self.common.handleErrors(err, res);
|
return self.common.handleErrors(err, res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var lastItem = items.find(a => a.confirmations !== 0), //assuming items is recent tx first order
|
||||||
|
lastItem = typeof lastItem === 'object' ? lastItem.txid: undefined
|
||||||
|
|
||||||
var ret = {
|
var ret = {
|
||||||
totalItems: result.totalCount,
|
totalItems: result.totalCount,
|
||||||
lastItem: items.find(a => a.confirmations !== 0), //assuming items is recent tx first order
|
lastItem: lastItem,
|
||||||
//from: options.from,
|
//from: options.from,
|
||||||
//to: Math.min(options.to, result.totalCount),
|
//to: Math.min(options.to, result.totalCount),
|
||||||
items: items
|
items: items
|
||||||
@ -352,20 +355,20 @@ AddressController.prototype.multitxs_ws = function(ws, req) {
|
|||||||
return self.common.handleErrors_ws(err, ws, false);
|
return self.common.handleErrors_ws(err, ws, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
self.txController.transformTransaction(tx, transformOptions, function(err, data){
|
self.txController.transformTransaction(data, transformOptions, function(err, tx){
|
||||||
|
|
||||||
if(err) {
|
if(err) {
|
||||||
return self.common.handleErrors_ws(err, ws, false);
|
return self.common.handleErrors_ws(err, ws, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//finding the last key (useful for `after` option on next request call)
|
//finding the last key (useful for `after` option on next request call)
|
||||||
if(data.confirmations)
|
if(tx.confirmations)
|
||||||
if(lastItem.height < data.blockheight || (lastItem.height == data.blockheight && lastItem.id < data.txid)){
|
if(lastItem.height < tx.blockheight || (lastItem.height == tx.blockheight && lastItem.id < tx.txid)){
|
||||||
lastItem.id = data.txid;
|
lastItem.id = tx.txid;
|
||||||
lastItem.height = data.blockheight;
|
lastItem.height = tx.blockheight;
|
||||||
}
|
}
|
||||||
|
|
||||||
ws.send({data})
|
ws.send({data: tx})
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user