Skip to content

Commit 8726df8

Browse files
authored
Merge pull request #2389 from tronprotocol/release_3.6.2
Release 3.6.2 merge to master
2 parents fd3c7af + ef8838a commit 8726df8

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

.travis.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ language: java
44
jdk: oraclejdk8
55
addons:
66
ssh_known_hosts:
7-
- 47.93.42.145:22008
8-
- 47.93.42.145:22008
9-
- 47.93.42.145:22008
10-
- 47.93.18.60:22008
11-
- 47.93.18.60:22008
12-
- 47.93.18.60:22008
7+
- 47.93.42.145:22008
8+
- 47.93.42.145:22008
9+
- 47.93.42.145:22008
10+
- 47.93.18.60:22008
11+
- 47.93.18.60:22008
12+
- 47.93.18.60:22008
1313
sonarcloud:
1414
organization: tron-zhaohong
1515
token:
1616
secure: "KXWEeQ1elAoQ0XfR54TQWfhrIdDP0+2CYPv2X9aWpU/YDl7hqZBAjcCOAUGvlbyM54jtG6YMaWwG48jlrOwwl5l/VjWSnUXF+7ixQy5ki0Ci9s7Y1pTQwV9SpL8TLIK2TYqabN8Mw+FJULASXLjYr9GerbbcUbCPTmcL6mQKw6ivxxpNPmz4eNoKAEuOzruO9fTXGAV3yr8Nn85c+mVxV8EUhkR17zpE9O8fvzOtSnYArWNOSCgDBn0EG45UNNPF2vn44s1c3h3gX1m3WK6PeCXPgy3hPqRn3wTG+xglnbqthGpo2wt1rJ83af+BwdYwvPEcUq84yLgXcE/aMkTKcVAfPWBP/6vblaoI90jxCeFji+MdMimKZAqIXt7oLqDZVmIq65de5YC5s7QTSbzJNY/tsAu3dqzSfbUJY6CRNFDcoenVpvgQkqb37TkDah4mJM8EUjbu2A9Q2HSFbyCVsQJtdasuu9cBOf6azK3U0XgFNBc0y2aziZrTnX30q7bi+5L/mbTnRdXrDqBOqyPeGtT77UZfcajHHmEWU/e6gYWiA/c+K25n13DD53Au6gpnnQ6ALeUl/1gDwz3fPBebJ5bVWrkIcLj7bbysjzfOvQmDS6G13RNz58Hm0/B7bVtZTr1E1q6Z1zEJwbuJYEJASNcezAfK5x/hIfZTGNqT3M8="
1717
cache:
1818
directories:
19-
- '$HOME/.sonar/cache'
19+
- '$HOME/.sonar/cache'
2020
matrix:
2121
include:
2222
- name: build

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ apply plugin: 'com.github.johnrengelman.shadow'
2323
apply plugin: "jacoco"
2424
apply plugin: 'maven-publish'
2525

26-
jar.enabled = false
26+
jar.enabled = true
2727
shadowJar.enabled = true
2828

2929
sourceCompatibility = 1.8

src/main/java/org/tron/core/services/WitnessService.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22

33
import static org.tron.core.witness.BlockProductionCondition.NOT_MY_TURN;
44

5+
import com.google.common.cache.Cache;
6+
import com.google.common.cache.CacheBuilder;
57
import com.google.common.collect.Maps;
68
import com.google.protobuf.ByteString;
79
import java.util.Arrays;
810
import java.util.Map;
911
import java.util.Random;
12+
import java.util.concurrent.TimeUnit;
1013
import java.util.concurrent.atomic.AtomicInteger;
1114
import java.util.concurrent.atomic.AtomicLong;
1215
import lombok.Getter;
@@ -36,6 +39,7 @@
3639
import org.tron.core.exception.ValidateSignatureException;
3740
import org.tron.core.net.TronNetService;
3841
import org.tron.core.net.message.BlockMessage;
42+
import org.tron.core.net.peer.Item;
3943
import org.tron.core.witness.BlockProductionCondition;
4044
import org.tron.core.witness.WitnessController;
4145

@@ -77,6 +81,7 @@ public class WitnessService implements Service {
7781
private AtomicLong dupBlockTime = new AtomicLong(0);
7882
private long blockCycle =
7983
ChainConstant.BLOCK_PRODUCED_INTERVAL * ChainConstant.MAX_ACTIVE_WITNESS_NUM;
84+
private Cache<ByteString, Long> blocks = CacheBuilder.newBuilder().maximumSize(10).build();
8085

8186
/**
8287
* Construction method.
@@ -338,6 +343,11 @@ private boolean dupWitnessCheck() {
338343

339344
public void checkDupWitness(BlockCapsule block) {
340345
if (block.generatedByMyself) {
346+
blocks.put(block.getBlockId().getByteString(), System.currentTimeMillis());
347+
return;
348+
}
349+
350+
if (blocks.getIfPresent(block.getBlockId().getByteString()) != null) {
341351
return;
342352
}
343353

src/main/resources/config.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ node {
149149
]
150150

151151
fastForward = [
152-
"47.90.208.194:18888",
153-
"47.75.212.39:18888"
152+
"100.26.245.209:18888",
153+
"15.188.6.125:18888"
154154
]
155155

156156
http {

0 commit comments

Comments
 (0)