Skip to content
This repository has been archived by the owner on Oct 8, 2019. It is now read-only.

Commit

Permalink
fix(BCH): set payment to to bch address
Browse files Browse the repository at this point in the history
  • Loading branch information
plondon committed Dec 2, 2017
1 parent 14f7487 commit f273264
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
5 changes: 1 addition & 4 deletions app/partials/send/send-bitcoin-cash.pug
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@
accounts="origins"
ng-model="transaction.destination"
ng-model-options="{ updateOn: 'blur' }"
ng-change="checkForSameDestination()"
ng-paste="handlePaste($event)"
on-payment-request="applyPaymentRequest(request)"
set-input-metric="$parent.inputMetric = metric"
ignore="transaction.from"
required)
.has-error
Expand Down Expand Up @@ -118,4 +115,4 @@
.group.mt-25
button.button-primary(translate="CONTINUE" ng-click="goTo('send-confirm')" ng-disabled="sendForm.$invalid || transaction.amount > transaction.maxAvailable")
.flex-column.width-100(ng-if="onStep('send-confirm')")
send-confirm(tx="transaction" on-send="send()" asset="'bch'" on-go-back="goTo('send-cash')")
send-confirm(tx="transaction" on-send="send()" asset="'bch'" on-go-back="goTo('send-cash')" locked="locked")
1 change: 1 addition & 0 deletions app/partials/send/send-confirm.pug
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
ladda-translate="{{$ctrl.getButtonContent()}}"
ui-ladda="sending"
ng-click="$ctrl.onSend()"
ng-disabled="$ctrl.locked"
data-style="expand-left")
div.width-100.center.mt-10
a.f-14(ng-click="$ctrl.onGoBack()" translate="GO_BACK")
1 change: 1 addition & 0 deletions assets/js/components/send-confirm.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ angular
bindings: {
tx: '<',
asset: '<',
locked: '<',
onSend: '&',
onGoBack: '&'
},
Expand Down
6 changes: 5 additions & 1 deletion assets/js/controllers/send/sendBitcoinCash.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,16 @@ function SendBitcoinCashController ($rootScope, $scope, AngularHelper, Env, MyWa
};

$scope.send = () => {
let addr;
let tx = $scope.transaction;
let payment = $scope.transaction.from.createPayment();

if (!tx.destination.label) addr = tx.destination.address;
else addr = MyWallet.wallet.bch.accounts[tx.destination.index].receiveAddress;

$scope.lock();

payment.to(tx.destination);
payment.to(addr);
payment.amount(tx.amount);
payment.feePerByte(feePerByte);
payment.build();
Expand Down

0 comments on commit f273264

Please sign in to comment.