mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-03-10 17:26:28 +01:00
CoinSelection: add defensive copy in constructor
This commit is contained in:
parent
e8491bbd88
commit
82feb7b831
1 changed files with 2 additions and 1 deletions
|
@ -21,6 +21,7 @@ import org.bitcoinj.core.TransactionOutput;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -42,7 +43,7 @@ public class CoinSelection {
|
||||||
|
|
||||||
public CoinSelection(List<TransactionOutput> gathered) {
|
public CoinSelection(List<TransactionOutput> gathered) {
|
||||||
this.valueGathered = sumOutputValues(gathered);
|
this.valueGathered = sumOutputValues(gathered);
|
||||||
this.gathered = gathered;
|
this.gathered = Collections.unmodifiableList(new ArrayList<>(gathered));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue