forked from Qortal/qortal
Treat two block summaries as equal if they have matching signatures
This commit is contained in:
parent
44ec447014
commit
41505dae11
@ -2,6 +2,7 @@ package org.qortal.data.block;
|
|||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class BlockSummaryData {
|
public class BlockSummaryData {
|
||||||
@ -84,4 +85,21 @@ public class BlockSummaryData {
|
|||||||
this.minterLevel = minterLevel;
|
this.minterLevel = minterLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (o == null || getClass() != o.getClass())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
BlockSummaryData otherBlockSummary = (BlockSummaryData) o;
|
||||||
|
if (this.getSignature() == null || otherBlockSummary.getSignature() == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Treat two block summaries as equal if they have matching signatures
|
||||||
|
return Arrays.equals(this.getSignature(), otherBlockSummary.getSignature());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user