mirror of https://github.com/BTCPrivate/copay.git
Merge pull request #381 from maraoz/fix/tx-proposal-list
always show all copayers in tx proposal list
This commit is contained in:
commit
b94aaa69fe
|
@ -342,7 +342,7 @@
|
|||
<div class="transactions" data-ng-controller="TransactionsController">
|
||||
<div class="row" ng-show='$root.wallet.publicKeyRing.isComplete()'>
|
||||
<div class="large-12 columns">
|
||||
<h4>Transactions proposals <small>({{txs.length}})</small></h4>
|
||||
<h4>Transaction proposals <small>({{txs.length}})</small></h4>
|
||||
<div class="panel radius pending" ng-repeat="tx in txs | orderBy: 'createdTs':true">
|
||||
<div class="txheader">
|
||||
<div class="row m10">
|
||||
|
@ -364,7 +364,7 @@
|
|||
<div class="box-copayers" ng-repeat="(cId, actions) in tx.peerActions">
|
||||
<figure class="left">
|
||||
<a href="#/transactions" class="has-tip" tooltip-popup-delay='1000' tooltip="{{cId === $root.wallet.getMyCopayerId() ? 'You' : $root.wallet.publicKeyRing.nicknameForCopayer(cId)}}">
|
||||
<img src="./img/satoshi.gif" alt="cId" width="200">
|
||||
<img src="./img/satoshi.gif" alt="{{cId}}" width="200">
|
||||
</a>
|
||||
</figure>
|
||||
<div class="box-status">
|
||||
|
|
|
@ -180,8 +180,8 @@ TxProposals.prototype._mergeBuilder = function(myTxps, theirTxps, mergeInfo) {
|
|||
};
|
||||
|
||||
TxProposals.prototype.add = function(data) {
|
||||
var id = data.builder.build().getNormalizedHash().toString('hex');
|
||||
this.txps[id] = new TxProposal(data);
|
||||
var ntxid = data.builder.build().getNormalizedHash().toString('hex');
|
||||
this.txps[ntxid] = new TxProposal(data);
|
||||
};
|
||||
|
||||
|
||||
|
@ -191,12 +191,20 @@ TxProposals.prototype.setSent = function(ntxid,txid) {
|
|||
};
|
||||
|
||||
|
||||
TxProposals.prototype.getTxProposal = function(ntxid) {
|
||||
TxProposals.prototype.getTxProposal = function(ntxid, copayers) {
|
||||
var txp = this.txps[ntxid];
|
||||
var i = JSON.parse(JSON.stringify(txp));
|
||||
i.builder = txp.builder;
|
||||
i.ntxid = ntxid;
|
||||
i.peerActions = {};
|
||||
|
||||
if (copayers) {
|
||||
for(var j=0; j < copayers.length; j++) {
|
||||
var p = copayers[j];
|
||||
i.peerActions[p] = {};
|
||||
}
|
||||
}
|
||||
|
||||
for(var p in txp.seenBy){
|
||||
i.peerActions[p]={seen: txp.seenBy[p]};
|
||||
}
|
||||
|
|
|
@ -222,12 +222,23 @@ Wallet.prototype.getOnlinePeerIDs = function() {
|
|||
return this.network.getOnlinePeerIDs();
|
||||
};
|
||||
|
||||
Wallet.prototype.getRegisteredCopayerIds = function() {
|
||||
var l = this.publicKeyRing.registeredCopayers();
|
||||
var copayers = [];
|
||||
for (var i = 0; i < l; i++) {
|
||||
var cid = this.getCopayerId(i);
|
||||
copayers.push(cid);
|
||||
}
|
||||
return copayers;
|
||||
};
|
||||
|
||||
Wallet.prototype.getRegisteredPeerIds = function() {
|
||||
var l = this.publicKeyRing.registeredCopayers();
|
||||
if (this.registeredPeerIds.length !== l) {
|
||||
this.registeredPeerIds = [];
|
||||
var copayers = this.getRegisteredCopayerIds();
|
||||
for (var i = 0; i < l; i++) {
|
||||
var cid = this.getCopayerId(i);
|
||||
var cid = copayers[i];
|
||||
var pid = this.network.peerFromCopayer(cid);
|
||||
this.registeredPeerIds.push({
|
||||
peerId: pid,
|
||||
|
@ -325,8 +336,9 @@ Wallet.prototype.generateAddress = function(isChange) {
|
|||
|
||||
Wallet.prototype.getTxProposals = function() {
|
||||
var ret = [];
|
||||
var copayers = this.getRegisteredCopayerIds();
|
||||
for (var k in this.txProposals.txps) {
|
||||
var i = this.txProposals.getTxProposal(k);
|
||||
var i = this.txProposals.getTxProposal(k, copayers);
|
||||
i.signedByUs = i.signedBy[this.getMyCopayerId()] ? true : false;
|
||||
i.rejectedByUs = i.rejectedBy[this.getMyCopayerId()] ? true : false;
|
||||
if (this.totalCopayers - i.rejectCount < this.requiredCopayers)
|
||||
|
|
Loading…
Reference in New Issue