use keys instead of changeAddress

23ca56fe05 (r25578957)
pull/74/head
moneroexamples 7 years ago
parent 80f2ef9585
commit 929869b20f

@ -1645,7 +1645,7 @@ var cnUtil = (function(initConfig) {
return sigs;
};
this.construct_tx = function(keys, sources, dsts, fee_amount, payment_id, pid_encrypt, realDestViewKey, unlock_time, rct, changeAddress) {
this.construct_tx = function(keys, sources, dsts, fee_amount, payment_id, pid_encrypt, realDestViewKey, unlock_time, rct) {
//we move payment ID stuff here, because we need txkey to encrypt
var txkey = this.random_keypair();
console.log(txkey);
@ -1749,9 +1749,11 @@ var cnUtil = (function(initConfig) {
var out_derivation;
if (dsts[i].address === changeAddress.address)
// if destination public view address matches our own public key
// we send change to ourself
if (dsts[i].keys.view === keys.view.pub)
{
out_derivation = this.generate_key_derivation(txkey.pub, changeAddress.view_key);
out_derivation = this.generate_key_derivation(txkey.pub, keys.view.sec);
}
else
{
@ -1840,7 +1842,7 @@ var cnUtil = (function(initConfig) {
console.log(tx);
return tx;
};
this.create_transaction = function(pub_keys, sec_keys, dsts, outputs, mix_outs, fake_outputs_count, fee_amount, payment_id, pid_encrypt, realDestViewKey, unlock_time, rct, changeAddress) {
this.create_transaction = function(pub_keys, sec_keys, dsts, outputs, mix_outs, fake_outputs_count, fee_amount, payment_id, pid_encrypt, realDestViewKey, unlock_time, rct) {
unlock_time = unlock_time || 0;
mix_outs = mix_outs || [];
var i, j;
@ -1960,7 +1962,7 @@ var cnUtil = (function(initConfig) {
} else if (cmp > 0) {
throw "Need more money than found! (have: " + cnUtil.formatMoney(found_money) + " need: " + cnUtil.formatMoney(needed_money) + ")";
}
return this.construct_tx(keys, sources, dsts, fee_amount, payment_id, pid_encrypt, realDestViewKey, unlock_time, rct, changeAddress);
return this.construct_tx(keys, sources, dsts, fee_amount, payment_id, pid_encrypt, realDestViewKey, unlock_time, rct);
};
this.estimateRctSize = function(inputs, mixin, outputs) {

@ -45,9 +45,6 @@ thinwalletCtrls.controller('SendCoinsCtrl', function($scope, $http, $q,
var view_only = AccountService.isViewOnly();
// our address and associated prv view key
var changeAddress = AccountService.getAddressAndViewKey();
var explorerUrl = config.testnet ? config.testnetExplorerUrl : config.mainnetExplorerUrl;
// few multiplayers based on uint64_t wallet2::get_fee_multiplier
@ -662,8 +659,7 @@ thinwalletCtrls.controller('SendCoinsCtrl', function($scope, $http, $q,
splittedDsts, using_outs,
mix_outs, mixin, neededFee,
payment_id, pid_encrypt,
realDestViewKey, 0, rct,
changeAddress);
realDestViewKey, 0, rct);
} catch (e) {
deferred.reject("Failed to create transaction: " + e);

@ -47,7 +47,7 @@
<div class="w-row">
<div class="w-col w-col-12 responsive-column">
<label class="field-label review" for="raw_tx_data">Raw tx data to be submitted to the backend</label>
<textarea id="raw_tx_data" rows="4" cols="105">{{transferConfirmDialog.raw_tx}}</textarea>
<textarea id="raw_tx_data" rows="4" style="width:100%">{{transferConfirmDialog.raw_tx}}</textarea>
</div>
</div>

Loading…
Cancel
Save