fix conflics

This commit is contained in:
Matias Alejo Garcia 2014-06-13 19:45:00 -03:00
commit 194e5fed54
7 changed files with 55 additions and 30 deletions

View file

@ -221,12 +221,19 @@ small.has-error {
.totalAmount {
font-weight: bold;
line-height: 120%;
margin-top:2px;
}
/* Turn Off Number Input Spinners */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
.small {
font-size: 60%;
line-height: inherit;

View file

@ -21,7 +21,7 @@
</div>
<div class="large-9 medium-9 small-9 columns text-center p10t" ng-show="$root.wallet">
<div class="large-4 medium-4 columns line-dashed-v">
<a href="#/addresses" class="has-tip" tooltip-placement="bottom" tooltip="{{$root.wallet.id}}">
<a href="#/addresses" class="has-tip" tooltip-placement="bottom" tooltip="ID: {{$root.wallet.id}}">
<strong><span>{{$root.wallet.getName()}}</span></strong>
</a>
<a class="button radius small-icon" title="Manual Refresh"
@ -655,7 +655,7 @@
<div class="small-9 columns">
<input type="number" id="amount" ng-disabled="loading"
name="amount" placeholder="Amount" ng-model="amount"
min="0.0001" max="10000000" enough-amount required
min="1" max="10000000000" enough-amount required
autocomplete="off"
>
</div>
@ -669,7 +669,10 @@
Total amount for this transaction:
</small>
<div class="totalAmount">
{{amount + defaultFee |number}}</b> bits
<b>{{amount + defaultFee |number}}</b> bits
<small>
{{((amount + defaultFee)/1e6).toFixed(3) |number}} BTC
</small>
</div>
<small>
Including fee of {{defaultFee|number}} bits
@ -687,7 +690,7 @@
</label>
<div class="small-12 columns">
<textarea id="comment" ng-disabled="loading"
name="comment" placeholder="Leave a private message to your copayers" ng-model="comment" ng-maxlength="100"></textarea>
name="comment" placeholder="Leave a private message to your copayers" ng-model="commentText" ng-maxlength="100"></textarea>
</div>
</div>
</div>

View file

@ -50,9 +50,11 @@ angular.module('copayApp.controllers').controller('SendController',
var address = form.address.$modelValue;
var amount = (form.amount.$modelValue * 100) | 0;
var commentText = form.comment.$modelValue;
var w = $rootScope.wallet;
w.createTx(address, amount, comment, function() {
w.createTx(address, amount, commentText, function() {
$scope.loading = false;
$rootScope.$flashMessage = {
message: 'The transaction proposal has been created',

View file

@ -183,34 +183,35 @@ Insight.prototype._request = function(options, callback) {
request.timeout = 5000;
request.ontimeout = function() {
setTimeout(function() {
return self._request(options,callback);
return self._request(options, callback);
}, self.retryDelay);
return callback(new Error('Insight request timeout'));
};
request.onreadystatechange = function() {
if (request.readyState === 4) {
if (request.status === 200 || request.status === 304) {
try {
var ret = JSON.parse(request.responseText);
return callback(null, ret);
} catch (e) {
return callback(new Error('CRITICAL: Wrong response from insight'));
}
}
// User error
else if (request.status >= 400 && request.status < 499) {
return callback(new Error('CRITICAL: Bad request to insight. Probably wrong transaction to broadcast?.'));
}
else {
var err= 'Error code: ' + request.status + ' - Status: ' + request.statusText
+ ' - Description: ' + request.responseText;
setTimeout(function() {
return self._request(options,callback);
}, self.retryDelay);
return callback(new Error(err));
if (request.readyState !== 4) return;
var ret, errTxt, e;
if (request.status === 200 || request.status === 304) {
try {
ret = JSON.parse(request.responseText);
} catch (e2) {
errTxt = 'CRITICAL: Wrong response from insight' + e2;
}
} else if (request.status >= 400 && request.status < 499) {
errTxt = 'CRITICAL: Bad request to insight. Probably wrong transaction to broadcast?.';
} else {
errTxt = 'Error code: ' + request.status + ' - Status: ' + request.statusText + ' - Description: ' + request.responseText;
setTimeout(function() {
console.log('### Retrying Insight Request....');
return self._request(options, callback);
}, self.retryDelay);
}
if (errTxt) {
console.log("INSIGHT ERROR:", e);
e = new Error(errTxt);
}
return callback(e, ret);
};
if (options.method === 'POST') {
@ -218,9 +219,7 @@ Insight.prototype._request = function(options, callback) {
}
request.send(options.data || null);
}
else {
} else {
var http = require('http');
var req = http.request(options, function(response) {
var ret;

View file

@ -24,6 +24,8 @@ function TxProposal(opts) {
}
TxProposal.prototype.toObj = function() {
console.log('[TxProposals.js.27]',this); //TODO
var o = JSON.parse(JSON.stringify(this));
delete o['builder'];
o.builderObj = this.builder.toObj();

View file

@ -572,6 +572,10 @@ Wallet.prototype.getBalance = function(cb) {
if (!BIT)
throw new Error('BIT not defined. A newer version of bitcore is needed');
console.log('[Wallet.js.574] getBalance'); //TODO
this.getUnspent(function(err, safeUnspent, unspent) {
if (err) {
return cb(err);
@ -604,6 +608,7 @@ Wallet.prototype.getBalance = function(cb) {
Wallet.prototype.getUnspent = function(cb) {
var self = this;
this.blockchain.getUnspent(this.getAddressesStr(), function(err, unspentList) {
console.log('[Wallet.js.606:unspentList:]', unspentList); //TODO
if (err) {
return cb(err);
@ -637,6 +642,7 @@ Wallet.prototype.createTx = function(toAddress, amountSatStr, comment, opts, cb)
}
this.getUnspent(function(err, safeUnspent) {
console.log('[Wallet.js.639:safeUnspent:]', safeUnspent); //TODO
var ntxid = self.createTxSync(toAddress, amountSatStr, comment, safeUnspent, opts);
if (ntxid) {
self.sendIndexes();

View file

@ -108,6 +108,8 @@ angular.module('copayApp.services')
root.updateTxs({onlyPending:true});
// give sometime to the tx to propagate.
$timeout(function() {
console.log('[controllerUtils.js.111] UPDATE BALANCE'); //TODO
root.updateBalance(function(){
if (!dontDigest) {
$rootScope.$digest();
@ -142,7 +144,11 @@ angular.module('copayApp.services')
$rootScope.balanceByAddr = {};
$rootScope.updatingBalance = true;
console.log('[controllerUtils.js.147] GET'); //TODO
w.getBalance(function(err, balance, balanceByAddr, safeBalance) {
console.log('[controllerUtils.js.150]', err, balance); //TODO
if (err) {
console.error('Error: ' + err.message); //TODO
root._setCommError();