Remove extra Tx fields
This commit is contained in:
@@ -573,7 +573,6 @@ void MainWindow::postToZBoard() {
|
|||||||
auto toAddr = topics[zb.topicsList->currentText()];
|
auto toAddr = topics[zb.topicsList->currentText()];
|
||||||
tx.toAddrs.push_back(ToFields{ toAddr, Settings::getZboardAmount(), memo, memo.toUtf8().toHex() });
|
tx.toAddrs.push_back(ToFields{ toAddr, Settings::getZboardAmount(), memo, memo.toUtf8().toHex() });
|
||||||
tx.fee = Settings::getMinerFee();
|
tx.fee = Settings::getMinerFee();
|
||||||
tx.sendChangeToSapling = false;
|
|
||||||
|
|
||||||
json params = json::array();
|
json params = json::array();
|
||||||
rpc->fillTxJsonParams(params, tx);
|
rpc->fillTxJsonParams(params, tx);
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ struct Tx {
|
|||||||
QString fromAddr;
|
QString fromAddr;
|
||||||
QList<ToFields> toAddrs;
|
QList<ToFields> toAddrs;
|
||||||
double fee;
|
double fee;
|
||||||
bool sendChangeToSapling;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
|||||||
@@ -395,7 +395,7 @@ Tx MainWindow::createTxFromSendPage() {
|
|||||||
tx.fee = Settings::getMinerFee();
|
tx.fee = Settings::getMinerFee();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sendChangeToSapling) {
|
if (Settings::getInstance()->getAutoShield() && sendChangeToSapling) {
|
||||||
auto saplingAddr = std::find_if(rpc->getAllZAddresses()->begin(), rpc->getAllZAddresses()->end(), [=](auto i) -> bool {
|
auto saplingAddr = std::find_if(rpc->getAllZAddresses()->begin(), rpc->getAllZAddresses()->end(), [=](auto i) -> bool {
|
||||||
// We're finding a sapling address that is not one of the To addresses, because zcash doesn't allow duplicated addresses
|
// We're finding a sapling address that is not one of the To addresses, because zcash doesn't allow duplicated addresses
|
||||||
bool isSapling = Settings::getInstance()->isSaplingAddress(i);
|
bool isSapling = Settings::getInstance()->isSaplingAddress(i);
|
||||||
@@ -409,11 +409,11 @@ Tx MainWindow::createTxFromSendPage() {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (saplingAddr != rpc->getAllZAddresses()->end()) {
|
if (saplingAddr != rpc->getAllZAddresses()->end()) {
|
||||||
tx.sendChangeToSapling = sendChangeToSapling;
|
|
||||||
double change = rpc->getAllBalances()->value(tx.fromAddr) - totalAmt - tx.fee;
|
double change = rpc->getAllBalances()->value(tx.fromAddr) - totalAmt - tx.fee;
|
||||||
|
|
||||||
QString changeMemo = "change from " + tx.fromAddr;
|
QString changeMemo = "Change from " + tx.fromAddr;
|
||||||
tx.toAddrs.push_back( ToFields{*saplingAddr, change, changeMemo, changeMemo.toUtf8().toHex()} );
|
tx.toAddrs.push_back( ToFields{*saplingAddr, change, changeMemo, changeMemo.toUtf8().toHex()} );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -304,7 +304,7 @@ void Turnstile::executeMigrationStep() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create the Tx
|
// Create the Tx
|
||||||
auto tx = Tx{ nextStep->fromAddr, { to }, Settings::getMinerFee(), false };
|
auto tx = Tx{ nextStep->fromAddr, { to }, Settings::getMinerFee() };
|
||||||
|
|
||||||
// And send it
|
// And send it
|
||||||
doSendTx(tx, [=] () {
|
doSendTx(tx, [=] () {
|
||||||
@@ -339,7 +339,7 @@ void Turnstile::executeMigrationStep() {
|
|||||||
QList<ToFields> to = { ToFields{ nextStep->destAddr, sendAmt, "", "" } };
|
QList<ToFields> to = { ToFields{ nextStep->destAddr, sendAmt, "", "" } };
|
||||||
|
|
||||||
// Create the Tx
|
// Create the Tx
|
||||||
auto tx = Tx{ nextStep->intTAddr, to, Settings::getMinerFee(), false };
|
auto tx = Tx{ nextStep->intTAddr, to, Settings::getMinerFee()};
|
||||||
|
|
||||||
// And send it
|
// And send it
|
||||||
doSendTx(tx, [=] () {
|
doSendTx(tx, [=] () {
|
||||||
|
|||||||
Reference in New Issue
Block a user