Simplify RPCID
This commit is contained in:
parent
b7c6a7b45a
commit
aff5eb6cf4
2 changed files with 11 additions and 6 deletions
|
@ -146,17 +146,21 @@ public class DHT{
|
|||
|
||||
public static class RPCID{
|
||||
|
||||
private final DHT.Message<?> message;
|
||||
private final byte[] id;
|
||||
|
||||
public RPCID(DHT.Message<?> message){
|
||||
this.message = message;
|
||||
public RPCID(byte[] id){
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public RPCID(Message<?> message){
|
||||
this(message.rpcID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj){
|
||||
if(obj instanceof RPCID){
|
||||
RPCID other = (RPCID) obj;
|
||||
return Arrays.equals(this.message.rpcID,other.message.rpcID);// && Arrays.equals(this.message.nodeID,other.nodeID);
|
||||
return Arrays.equals(this.id,other.id);
|
||||
}
|
||||
return super.equals(obj);
|
||||
}
|
||||
|
@ -169,9 +173,10 @@ public class DHT{
|
|||
@Override
|
||||
public String toString() {
|
||||
return "RPCID{" +
|
||||
"rpcID=" + Hex.encode(this.message.rpcID) +
|
||||
"id=" + Hex.encode(id) +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ const POINT_COLOR = {
|
|||
};
|
||||
|
||||
const POINT_TTL = {
|
||||
blockchain: 60,
|
||||
blockchain: 60 * 2,
|
||||
};
|
||||
|
||||
const POINT_RADIUS = {
|
||||
|
|
Loading…
Add table
Reference in a new issue