add getUsedUnspent to txproposals
This commit is contained in:
parent
22eab0205b
commit
0523d99eda
4 changed files with 38 additions and 5 deletions
|
|
@ -212,7 +212,6 @@ PublicKeyRing.prototype.getAddresses = function(onlyMain) {
|
|||
|
||||
PublicKeyRing.prototype.getRedeemScriptMap = function () {
|
||||
var ret = {};
|
||||
console.log('[PublicKeyRing.js.216]', this.changeAddressIndex, this.addressIndex); //TODO
|
||||
|
||||
for (var i=0; i<this.changeAddressIndex; i++) {
|
||||
ret[this.getAddress(i,true)] = this.getRedeemScript(i,true).getBuffer().toString('hex');
|
||||
|
|
|
|||
|
|
@ -181,6 +181,16 @@ TxProposals.prototype.setSent = function(ntxid,txid) {
|
|||
this.txps[ntxid].setSent(txid);
|
||||
};
|
||||
|
||||
TxProposals.prototype.getUsedUnspent = function() {
|
||||
var ret = [];
|
||||
for(var i in this.txps) {
|
||||
var u = this.txps[i].builder.getSelectedUnspent();
|
||||
for (var j in u){
|
||||
ret.push(u[j].txid);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
TxProposals.prototype.merge = function(t) {
|
||||
if (this.network.name !== t.network.name)
|
||||
|
|
|
|||
|
|
@ -433,7 +433,7 @@ Wallet.prototype.getBalance = function(cb) {
|
|||
}
|
||||
for(var a in balanceByAddr){
|
||||
balanceByAddr[a] = balanceByAddr[a]/COIN;
|
||||
};
|
||||
}
|
||||
return cb(balance / COIN, balanceByAddr, isMain);
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue