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 4eeaf7df6..a584949a3 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}} {{$root.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,11 +275,11 @@
-
+
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 561533b8f..e849022f5 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/PrivateKey.js b/js/models/core/PrivateKey.js index 66102e8db..bf8cfa9de 100644 --- a/js/models/core/PrivateKey.js +++ b/js/models/core/PrivateKey.js @@ -32,8 +32,6 @@ PrivateKey.fromObj = function(obj) { }; PrivateKey.prototype.toObj = function() { - -console.log('[PrivateKey.js.35] TODO TODO: PRIV: ', this.getExtendedPrivateKeyString()); //TODO return { extendedPrivateKeyString: this.getExtendedPrivateKeyString(), networkName: this.network.name, diff --git a/js/models/core/TxProposals.js b/js/models/core/TxProposals.js index 28f9dadbe..e3f087af7 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();; }; @@ -64,7 +66,6 @@ TxProposals.fromObj = function(o) { o.txps.forEach(function(o2) { var t = TxProposal.fromObj(o2); var id = t.builder.build().getNormalizedHash().toString('hex'); -console.log('[TxProposals.js.65:id:]',id, o2); //TODO ret.txps[id] = t; }); return ret; @@ -127,7 +128,6 @@ TxProposals.prototype._mergeMetadata = function(myTxps, theirTxps, mergeInfo) { Object.keys(toMerge).forEach(function(hash) { var v0 = myTxps[hash]; var v1 = toMerge[hash]; -console.log('[TxProposals.js.127:v0:]',v0, v1); //TODO Object.keys(v1.seenBy).forEach(function(k) { if (!v0.seenBy[k] || v0.seenBy[k] !== v1.seenBy[k]) { @@ -143,13 +143,13 @@ 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++; } }); -console.log('[TxProposals.js.131:hasChanged:]',hasChanged); //TODO return hasChanged; }; @@ -168,20 +168,17 @@ TxProposals.prototype._mergeBuilder = function(myTxps, theirTxps, mergeInfo) { var after = JSON.stringify(v0.toObj()); if (after !== before) hasChanged ++; } -console.log('[TxProposals.js.149:hasChanged:]',hasChanged); //TODO }; TxProposals.prototype.add = function(data) { var id = data.builder.build().getNormalizedHash().toString('hex'); -console.log('[TxProposals.js.175:data: ADD]',data); //TODO this.txps[id] = new TxProposal(data); }; -TxProposals.prototype.setSent = function(ntxid) { +TxProposals.prototype.setSent = function(ntxid,txid) { //sent TxProposals are local an not broadcasted. -console.log('[TxProposals.js.147] SET SENT:', ntxid); //TODO - this.txps[ntxid].setSent(); + this.txps[ntxid].setSent(txid); }; diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index e82bff825..388656018 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