Refactory get balance 's methods
This commit is contained in:
parent
e88c80bc3e
commit
f55d243bed
5 changed files with 24 additions and 26 deletions
|
|
@ -29,17 +29,6 @@ function _asyncForEach(array, fn, callback) {
|
|||
}
|
||||
};
|
||||
|
||||
Insight.prototype.getBalance = function(unspent) {
|
||||
var balance = 0;
|
||||
for(var i=0;i<unspent.length; i++) {
|
||||
balance = balance + unspent[i].amount;
|
||||
}
|
||||
if (balance) {
|
||||
balance = balance.toFixed(4);
|
||||
}
|
||||
return balance;
|
||||
};
|
||||
|
||||
Insight.prototype.listUnspent = function(addresses, cb) {
|
||||
var self = this;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue