diff --git a/core/src/main/java/bisq/core/dao/node/explorer/JsonTxOutputType.java b/core/src/main/java/bisq/core/dao/node/explorer/JsonTxOutputType.java index 0018f273d50..a5657bfaf86 100644 --- a/core/src/main/java/bisq/core/dao/node/explorer/JsonTxOutputType.java +++ b/core/src/main/java/bisq/core/dao/node/explorer/JsonTxOutputType.java @@ -43,7 +43,7 @@ enum JsonTxOutputType { INVALID_OUTPUT("Invalid"); @Getter - private String displayString; + private final String displayString; JsonTxOutputType(String displayString) { this.displayString = displayString; diff --git a/core/src/main/java/bisq/core/dao/node/explorer/JsonTxType.java b/core/src/main/java/bisq/core/dao/node/explorer/JsonTxType.java index d14e17f8a56..ee8ffd25279 100644 --- a/core/src/main/java/bisq/core/dao/node/explorer/JsonTxType.java +++ b/core/src/main/java/bisq/core/dao/node/explorer/JsonTxType.java @@ -40,7 +40,7 @@ enum JsonTxType { IRREGULAR("Irregular"); @Getter - private String displayString; + private final String displayString; JsonTxType(String displayString) { this.displayString = displayString; diff --git a/core/src/main/java/bisq/core/dao/node/lite/LiteNode.java b/core/src/main/java/bisq/core/dao/node/lite/LiteNode.java index b43fa45313a..c0c8b64980c 100644 --- a/core/src/main/java/bisq/core/dao/node/lite/LiteNode.java +++ b/core/src/main/java/bisq/core/dao/node/lite/LiteNode.java @@ -59,7 +59,7 @@ public class LiteNode extends BsqNode { private final BsqWalletService bsqWalletService; private final WalletsSetup walletsSetup; private Timer checkForBlockReceivedTimer; - private ChangeListener blockDownloadListener; + private final ChangeListener blockDownloadListener; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/core/src/main/java/bisq/core/dao/node/lite/network/LiteNodeNetworkService.java b/core/src/main/java/bisq/core/dao/node/lite/network/LiteNodeNetworkService.java index 8412cf86be2..f13d99aa8b4 100644 --- a/core/src/main/java/bisq/core/dao/node/lite/network/LiteNodeNetworkService.java +++ b/core/src/main/java/bisq/core/dao/node/lite/network/LiteNodeNetworkService.java @@ -152,7 +152,7 @@ public void requestBlocks(int startBlockHeight) { .filter(peerManager::isSeedNode) .findAny(); - connectionToSeedNodeOptional.flatMap(e -> e.getPeersNodeAddressOptional()) + connectionToSeedNodeOptional.flatMap(Connection::getPeersNodeAddressOptional) .ifPresentOrElse(candidate -> { seedNodeAddresses.remove(candidate); requestBlocks(candidate, startBlockHeight); diff --git a/core/src/main/java/bisq/core/dao/node/parser/TempTx.java b/core/src/main/java/bisq/core/dao/node/parser/TempTx.java index e7bac4d2e34..b98d2f4579b 100644 --- a/core/src/main/java/bisq/core/dao/node/parser/TempTx.java +++ b/core/src/main/java/bisq/core/dao/node/parser/TempTx.java @@ -27,7 +27,8 @@ import java.util.Objects; import java.util.stream.Collectors; -import lombok.Data; +import lombok.Getter; +import lombok.Setter; import javax.annotation.Nullable; @@ -36,7 +37,8 @@ * After parsing it will get cloned to the immutable Tx. * We don't need to implement the ProtoBuffer methods as it is not persisted or sent over the wire. */ -@Data +@Getter +@Setter public class TempTx extends BaseTx { static TempTx fromRawTx(RawTx rawTx) { return new TempTx(rawTx.getTxVersion(), diff --git a/core/src/main/java/bisq/core/dao/node/parser/TempTxOutput.java b/core/src/main/java/bisq/core/dao/node/parser/TempTxOutput.java index 0109dc656fc..8aa78c2b08f 100644 --- a/core/src/main/java/bisq/core/dao/node/parser/TempTxOutput.java +++ b/core/src/main/java/bisq/core/dao/node/parser/TempTxOutput.java @@ -24,7 +24,8 @@ import java.util.Objects; -import lombok.Data; +import lombok.Getter; +import lombok.Setter; import javax.annotation.Nullable; @@ -32,7 +33,8 @@ * Contains mutable BSQ specific data (TxOutputType) and used only during tx parsing. * Will get converted to immutable TxOutput after tx parsing is completed. */ -@Data +@Getter +@Setter public class TempTxOutput extends BaseTxOutput { static TempTxOutput fromRawTxOutput(RawTxOutput txOutput) { return new TempTxOutput(txOutput.getIndex(), @@ -78,6 +80,10 @@ private TempTxOutput(int index, this.unlockBlockHeight = unlockBlockHeight; } + public boolean isOpReturnOutput() { + // We do not check for pubKeyScript.scriptType.NULL_DATA because that is only set if dumpBlockchainData is true + return getOpReturnData() != null; + } @Override public String toString() { @@ -88,12 +94,6 @@ public String toString() { "\n} " + super.toString(); } - public boolean isOpReturnOutput() { - // We do not check for pubKeyScript.scriptType.NULL_DATA because that is only set if dumpBlockchainData is true - return getOpReturnData() != null; - } - - // Enums must not be used directly for hashCode or equals as it delivers the Object.hashCode (internal address)! // The equals and hashCode methods cannot be overwritten in Enums. @Override diff --git a/core/src/main/java/bisq/core/dao/node/parser/TxOutputParser.java b/core/src/main/java/bisq/core/dao/node/parser/TxOutputParser.java index cf6815d5283..7f311d64061 100644 --- a/core/src/main/java/bisq/core/dao/node/parser/TxOutputParser.java +++ b/core/src/main/java/bisq/core/dao/node/parser/TxOutputParser.java @@ -87,9 +87,9 @@ */ @Slf4j class TxOutputParser { - private static int ACTIVATE_HARD_FORK_1_HEIGHT_MAINNET = 605000; - private static int ACTIVATE_HARD_FORK_1_HEIGHT_TESTNET = 1583054; - private static int ACTIVATE_HARD_FORK_1_HEIGHT_REGTEST = 1; + private static final int ACTIVATE_HARD_FORK_1_HEIGHT_MAINNET = 605000; + private static final int ACTIVATE_HARD_FORK_1_HEIGHT_TESTNET = 1583054; + private static final int ACTIVATE_HARD_FORK_1_HEIGHT_REGTEST = 1; private final DaoStateService daoStateService; // Setters diff --git a/core/src/main/java/bisq/core/dao/node/parser/exceptions/BlockHashNotConnectingException.java b/core/src/main/java/bisq/core/dao/node/parser/exceptions/BlockHashNotConnectingException.java index 41635a5a17e..c97ee28e111 100644 --- a/core/src/main/java/bisq/core/dao/node/parser/exceptions/BlockHashNotConnectingException.java +++ b/core/src/main/java/bisq/core/dao/node/parser/exceptions/BlockHashNotConnectingException.java @@ -24,7 +24,7 @@ @Getter public class BlockHashNotConnectingException extends Exception { - private RawBlock rawBlock; + private final RawBlock rawBlock; public BlockHashNotConnectingException(RawBlock rawBlock) { this.rawBlock = rawBlock; diff --git a/core/src/main/java/bisq/core/dao/node/parser/exceptions/BlockHeightNotConnectingException.java b/core/src/main/java/bisq/core/dao/node/parser/exceptions/BlockHeightNotConnectingException.java index 875c5b256b2..09b39be6471 100644 --- a/core/src/main/java/bisq/core/dao/node/parser/exceptions/BlockHeightNotConnectingException.java +++ b/core/src/main/java/bisq/core/dao/node/parser/exceptions/BlockHeightNotConnectingException.java @@ -24,7 +24,7 @@ @Getter public class BlockHeightNotConnectingException extends Exception { - private RawBlock rawBlock; + private final RawBlock rawBlock; public BlockHeightNotConnectingException(RawBlock rawBlock) { this.rawBlock = rawBlock; diff --git a/core/src/main/java/bisq/core/dao/node/parser/exceptions/RequiredReorgFromSnapshotException.java b/core/src/main/java/bisq/core/dao/node/parser/exceptions/RequiredReorgFromSnapshotException.java index 59a36c66939..184676078cb 100644 --- a/core/src/main/java/bisq/core/dao/node/parser/exceptions/RequiredReorgFromSnapshotException.java +++ b/core/src/main/java/bisq/core/dao/node/parser/exceptions/RequiredReorgFromSnapshotException.java @@ -24,7 +24,7 @@ @Getter public class RequiredReorgFromSnapshotException extends Exception { - private RawBlock rawBlock; + private final RawBlock rawBlock; public RequiredReorgFromSnapshotException(RawBlock rawBlock) { this.rawBlock = rawBlock;