diff --git a/css/main.css b/css/main.css index 8c6913c2e..635c5efb2 100644 --- a/css/main.css +++ b/css/main.css @@ -243,3 +243,5 @@ button.secondary:hover { background-color: #FFDF00 !important;} .m30v {margin: 30px 0;} .m30a {margin: 30px auto;} .br100 {border-radius: 100%;} + + diff --git a/index.html b/index.html index 04fee0a18..040204a05 100644 --- a/index.html +++ b/index.html @@ -18,8 +18,8 @@
Wallet ID: {{$root.wallet.id}}
-

{{totalBalance}} BTC

-

0 BTC

+

{{totalBalance}}

+

0

@@ -215,11 +215,11 @@

Address

- {{addr}} {{balanceByAddr[addr] || 0}} BTC + {{addr}} {{balanceByAddr[addr] || 0}}
-

{{balanceByAddr[addr]}} BTC

+

{{balanceByAddr[addr]}}

Create a New Address

@@ -241,7 +241,7 @@
- ntxid: {{tx.ntxid}} + Proposal ID: {{tx.ntxid}}
created at {{tx.createdTs | date:'medium'}} @@ -251,20 +251,23 @@
- - - - - - - - +
CreatorTo address
- - - + + + + +
{{tx.creator}}{{o.value}} BTC{{o.address}}{{o.value}} + {{o.address}}
+ You + {{peer}} + : + + {{action}} + +
@@ -272,7 +275,7 @@
-
+
Signed by you already
@@ -294,7 +297,9 @@ + Sent at {{tx.sentTs | date:'medium'}} + TXID: tx.sentTxid One signature missing diff --git a/js/controllers/transactions.js b/js/controllers/transactions.js index 39bf65282..6c7847262 100644 --- a/js/controllers/transactions.js +++ b/js/controllers/transactions.js @@ -14,11 +14,7 @@ console.log('[transactions.js.10:_updateTxs:]'); //TODO var txs = []; inT.forEach(function(i){ - var b = i.txp.builder; - var tx = b.build(); - var one = { - feeSat: b.feeSat, - }; + var tx = i.builder.build(); var outs = []; tx.outs.forEach(function(o) { @@ -30,19 +26,13 @@ console.log('[transactions.js.10:_updateTxs:]'); //TODO }); } }); - one.outs = outs; - - // TOD: check missingSignatures === in al inputs? - one.missingSignatures = tx.countInputMissingSignatures(0); - one.signedByUs = i.signedByUs; - one.ntxid = i.ntxid; - one.creator = i.txp.creator; - one.createdTs = i.txp.createdTs; - one.sentTs = i.txp.sentTs; - txs.push(one); + // extra fields + i.outs = outs; + i.fee = i.feeSat/bitcore.util.COIN; + i.missingSignatures = tx.countInputMissingSignatures(0); + txs.push(i); }); $scope.txs = txs; -console.log('[transactions.js.55] SET HANDL+'); //TODO w.removeListener('txProposalsUpdated',_updateTxs) w.once('txProposalsUpdated',_updateTxs); }; diff --git a/js/models/core/TxProposals.js b/js/models/core/TxProposals.js index 28f9dadbe..20c8ee6aa 100644 --- a/js/models/core/TxProposals.js +++ b/js/models/core/TxProposals.js @@ -20,6 +20,7 @@ function TxProposal(opts) { this.signedBy = opts.signedBy || {}; this.builder = opts.builder; this.sentTs = opts.sentTs || null; + this.sentTxid = opts.sentTxid || null; } TxProposal.prototype.toObj = function() { @@ -30,7 +31,8 @@ TxProposal.prototype.toObj = function() { }; -TxProposal.prototype.setSent = function() { +TxProposal.prototype.setSent = function(sentTxid) { + this.sentTxid = txid; this.sentTs = Date.now();; }; @@ -143,8 +145,9 @@ console.log('[TxProposals.js.127:v0:]',v0, v1); //TODO } }); - if (!v0.sentTs && v1.sentTs) { - v0.sentTs = v1.sentTs; + if (!v0.sentTxid && v1.sentTxid) { + v0.sentTs = v1.sentTs; + v0.sentTxid = v1.sentTxid; hasChanged++; } diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index e82bff825..869b851c3 100644 --- a/js/models/core/Wallet.js +++ b/js/models/core/Wallet.js @@ -77,12 +77,7 @@ Wallet.prototype._handleTxProposals = function(senderId, data, isInbound) { var recipients; var inTxp = copay.TxProposals.fromObj(data.txProposals); var mergeInfo = this.txProposals.merge(inTxp, true); -console.log('[Wallet.js.79:inTxp:]',inTxp); //TODO - var addSeen = this.addSeenToTxProposals(); - -console.log('[Wallet.js.81]', addSeen, mergeInfo); //TODO -// if ((mergeInfo.merged && !data.isBroadcast) || addSeen) { if (mergeInfo.hasChanged || addSeen) { this.log('### BROADCASTING txProposals. ' ); recipients = null; @@ -168,7 +163,6 @@ Wallet.prototype.getMyPeerId = function() { }; Wallet.prototype.netStart = function() { -console.log('[Wallet.js.159:netStart:]'); //TODO var self = this; var net = this.network; net.removeAllListeners(); @@ -188,7 +182,6 @@ console.log('[Wallet.js.159:netStart:]'); //TODO peerId: myPeerId }; net.start(function() { -console.log('[Wallet.js.177] NET START: emit CREATED'); //TODO self.emit('created'); for (var i=0; i