Skip to content

Commit

Permalink
Make Transaction.Builder.addOperation thread safe
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekn committed Feb 18, 2016
1 parent ffe307d commit 248a4a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/org/stellar/sdk/Transaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import static com.google.common.base.Preconditions.checkArgument;
Expand Down Expand Up @@ -180,7 +181,7 @@ public static class Builder {
public Builder(TransactionBuilderAccount sourceAccount) {
checkNotNull(sourceAccount, "sourceAccount cannot be null");
mSourceAccount = sourceAccount;
mOperations = new ArrayList<Operation>();
mOperations = Collections.synchronizedList(new ArrayList<Operation>());
}

/**
Expand Down

0 comments on commit 248a4a1

Please sign in to comment.