convert input to object
This commit is contained in:
parent
ac774ba9e8
commit
bede8a96ea
|
@ -34,7 +34,8 @@ AddressModule.prototype.getAPIMethods = function() {
|
|||
['getOutputs', this, this.getOutputs, 2],
|
||||
['getUnspentOutputs', this, this.getUnspentOutputs, 2],
|
||||
['isSpent', this, this.isSpent, 2],
|
||||
['getTransactionsForAddress', this, this.getTransactionsForAddress, 2]
|
||||
['getTransactionsForAddress', this, this.getTransactionsForAddress, 2],
|
||||
['getSpendTxForOutput', this, this.getSpendTxForOutput, 3]
|
||||
];
|
||||
};
|
||||
|
||||
|
@ -120,9 +121,10 @@ AddressModule.prototype.blockHandler = function(block, addOutput, callback) {
|
|||
}
|
||||
|
||||
for(var j = 0; j < inputs.length; j++) {
|
||||
var input = inputs[j].toObject();
|
||||
operations.push({
|
||||
type: action,
|
||||
key: [AddressModule.PREFIXES.SPENTS, inputs[j].prevTxId, inputs[j].outputIndex].join('-'),
|
||||
key: [AddressModule.PREFIXES.SPENTS, input.prevTxId, input.outputIndex].join('-'),
|
||||
value: txid
|
||||
});
|
||||
}
|
||||
|
@ -324,7 +326,7 @@ AddressModule.prototype.getTransactionsForAddress = function(address, queryMempo
|
|||
|
||||
transactions.push(tx);
|
||||
|
||||
self.db.getSpendTxForOutput(output.txid, output.outputIndex, queryMempool, function(err, tx) {
|
||||
self.getSpendTxForOutput(output.txid, output.outputIndex, queryMempool, function(err, tx) {
|
||||
if(err instanceof levelup.errors.NotFoundError) {
|
||||
return next();
|
||||
} else if(err) {
|
||||
|
|
Loading…
Reference in New Issue