Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug with mutating account after saving #3612

Merged
merged 1 commit into from Nov 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -103,7 +103,6 @@ protected void deactivate() {
///////////////////////////////////////////////////////////////////////////////////////////

public void onSaveNewAccount(PaymentAccount paymentAccount) {
user.addPaymentAccount(paymentAccount);
TradeCurrency singleTradeCurrency = paymentAccount.getSingleTradeCurrency();
List<TradeCurrency> tradeCurrencies = paymentAccount.getTradeCurrencies();
if (singleTradeCurrency != null) {
Expand All @@ -120,6 +119,8 @@ public void onSaveNewAccount(PaymentAccount paymentAccount) {
});
}

user.addPaymentAccount(paymentAccount);

if (!(paymentAccount instanceof AssetAccount))
accountAgeWitnessService.publishMyAccountAgeWitness(paymentAccount.getPaymentAccountPayload());
}
Expand Down
Expand Up @@ -106,7 +106,6 @@ protected void deactivate() {
///////////////////////////////////////////////////////////////////////////////////////////

public void onSaveNewAccount(PaymentAccount paymentAccount) {
user.addPaymentAccount(paymentAccount);
TradeCurrency singleTradeCurrency = paymentAccount.getSingleTradeCurrency();
List<TradeCurrency> tradeCurrencies = paymentAccount.getTradeCurrencies();
if (singleTradeCurrency != null) {
Expand All @@ -128,6 +127,8 @@ public void onSaveNewAccount(PaymentAccount paymentAccount) {
});
}

user.addPaymentAccount(paymentAccount);

accountAgeWitnessService.publishMyAccountAgeWitness(paymentAccount.getPaymentAccountPayload());
}

Expand Down