mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Apply code inspection
Cleanups
This commit is contained in:
parent
1fc8905634
commit
862b12fe03
@ -43,7 +43,7 @@ enum JsonTxOutputType {
|
||||
INVALID_OUTPUT("Invalid");
|
||||
|
||||
@Getter
|
||||
private String displayString;
|
||||
private final String displayString;
|
||||
|
||||
JsonTxOutputType(String displayString) {
|
||||
this.displayString = displayString;
|
||||
|
@ -40,7 +40,7 @@ enum JsonTxType {
|
||||
IRREGULAR("Irregular");
|
||||
|
||||
@Getter
|
||||
private String displayString;
|
||||
private final String displayString;
|
||||
|
||||
JsonTxType(String displayString) {
|
||||
this.displayString = displayString;
|
||||
|
@ -59,7 +59,7 @@ public class LiteNode extends BsqNode {
|
||||
private final BsqWalletService bsqWalletService;
|
||||
private final WalletsSetup walletsSetup;
|
||||
private Timer checkForBlockReceivedTimer;
|
||||
private ChangeListener<Number> blockDownloadListener;
|
||||
private final ChangeListener<Number> blockDownloadListener;
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -152,7 +152,7 @@ public class LiteNodeNetworkService implements MessageListener, ConnectionListen
|
||||
.filter(peerManager::isSeedNode)
|
||||
.findAny();
|
||||
|
||||
connectionToSeedNodeOptional.flatMap(e -> e.getPeersNodeAddressOptional())
|
||||
connectionToSeedNodeOptional.flatMap(Connection::getPeersNodeAddressOptional)
|
||||
.ifPresentOrElse(candidate -> {
|
||||
seedNodeAddresses.remove(candidate);
|
||||
requestBlocks(candidate, startBlockHeight);
|
||||
|
@ -27,7 +27,8 @@ import com.google.common.collect.ImmutableList;
|
||||
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 @@ import javax.annotation.Nullable;
|
||||
* 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(),
|
||||
|
@ -24,7 +24,8 @@ import bisq.core.dao.state.model.blockchain.TxOutputType;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@ -32,7 +33,8 @@ import javax.annotation.Nullable;
|
||||
* 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 @@ public class TempTxOutput extends BaseTxOutput {
|
||||
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 class TempTxOutput extends BaseTxOutput {
|
||||
"\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
|
||||
|
@ -87,9 +87,9 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
*/
|
||||
@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
|
||||
|
@ -24,7 +24,7 @@ import lombok.Getter;
|
||||
@Getter
|
||||
public class BlockHashNotConnectingException extends Exception {
|
||||
|
||||
private RawBlock rawBlock;
|
||||
private final RawBlock rawBlock;
|
||||
|
||||
public BlockHashNotConnectingException(RawBlock rawBlock) {
|
||||
this.rawBlock = rawBlock;
|
||||
|
@ -24,7 +24,7 @@ import lombok.Getter;
|
||||
@Getter
|
||||
public class BlockHeightNotConnectingException extends Exception {
|
||||
|
||||
private RawBlock rawBlock;
|
||||
private final RawBlock rawBlock;
|
||||
|
||||
public BlockHeightNotConnectingException(RawBlock rawBlock) {
|
||||
this.rawBlock = rawBlock;
|
||||
|
@ -24,7 +24,7 @@ import lombok.Getter;
|
||||
@Getter
|
||||
public class RequiredReorgFromSnapshotException extends Exception {
|
||||
|
||||
private RawBlock rawBlock;
|
||||
private final RawBlock rawBlock;
|
||||
|
||||
public RequiredReorgFromSnapshotException(RawBlock rawBlock) {
|
||||
this.rawBlock = rawBlock;
|
||||
|
Loading…
Reference in New Issue
Block a user