mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-23 22:46:56 +01:00
UTXO: Make fields final.
This commit is contained in:
parent
0857e339dd
commit
6629bfb4f4
1 changed files with 14 additions and 15 deletions
|
@ -32,13 +32,13 @@ import java.util.Objects;
|
|||
* Useful when working with free standing outputs.
|
||||
*/
|
||||
public class UTXO {
|
||||
private Coin value;
|
||||
private Script script;
|
||||
private Sha256Hash hash;
|
||||
private long index;
|
||||
private int height;
|
||||
private boolean coinbase;
|
||||
private String address;
|
||||
private final Coin value;
|
||||
private final Script script;
|
||||
private final Sha256Hash hash;
|
||||
private final long index;
|
||||
private final int height;
|
||||
private final boolean coinbase;
|
||||
private final String address;
|
||||
|
||||
/**
|
||||
* Creates a stored transaction output.
|
||||
|
@ -55,13 +55,7 @@ public class UTXO {
|
|||
int height,
|
||||
boolean coinbase,
|
||||
Script script) {
|
||||
this.hash = hash;
|
||||
this.index = index;
|
||||
this.value = value;
|
||||
this.height = height;
|
||||
this.script = script;
|
||||
this.coinbase = coinbase;
|
||||
this.address = "";
|
||||
this(hash, index, value, height, coinbase, script, "");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -81,7 +75,12 @@ public class UTXO {
|
|||
boolean coinbase,
|
||||
Script script,
|
||||
String address) {
|
||||
this(hash, index, value, height, coinbase, script);
|
||||
this.hash = hash;
|
||||
this.index = index;
|
||||
this.value = value;
|
||||
this.height = height;
|
||||
this.script = script;
|
||||
this.coinbase = coinbase;
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue