mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
Improve logging, fix toString
This commit is contained in:
parent
9f45abcf81
commit
ea818cf66b
@ -386,11 +386,11 @@ public class P2PDataStorage implements MessageListener, ConnectionListener {
|
||||
|
||||
private boolean isSequenceNrValid(int newSequenceNumber, ByteArray hashOfData) {
|
||||
if (sequenceNumberMap.containsKey(hashOfData)) {
|
||||
Integer storedSequenceNumber = sequenceNumberMap.get(hashOfData).sequenceNr;
|
||||
int storedSequenceNumber = sequenceNumberMap.get(hashOfData).sequenceNr;
|
||||
if (newSequenceNumber >= storedSequenceNumber) {
|
||||
return true;
|
||||
} else {
|
||||
log.info("Sequence number is invalid. sequenceNumber = "
|
||||
log.warn("Sequence number is invalid. sequenceNumber = "
|
||||
+ newSequenceNumber + " / storedSequenceNumber=" + storedSequenceNumber + "\n" +
|
||||
"That can happen if the data owner gets an old delayed data storage message.");
|
||||
return false;
|
||||
@ -402,9 +402,19 @@ public class P2PDataStorage implements MessageListener, ConnectionListener {
|
||||
|
||||
private boolean hasSequenceNrIncreased(int newSequenceNumber, ByteArray hashOfData) {
|
||||
if (sequenceNumberMap.containsKey(hashOfData)) {
|
||||
Integer storedSequenceNumber = sequenceNumberMap.get(hashOfData).sequenceNr;
|
||||
int storedSequenceNumber = sequenceNumberMap.get(hashOfData).sequenceNr;
|
||||
if (newSequenceNumber > storedSequenceNumber) {
|
||||
return true;
|
||||
} else if (newSequenceNumber == storedSequenceNumber) {
|
||||
if (newSequenceNumber == 0) {
|
||||
log.trace("Sequence number is equal to the stored one and both are 0." +
|
||||
"That is expected for messages which never got updated (mailbox msg).");
|
||||
return false;
|
||||
} else {
|
||||
log.trace("Sequence number is equal to the stored one. sequenceNumber = "
|
||||
+ newSequenceNumber + " / storedSequenceNumber=" + storedSequenceNumber);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
log.warn("Sequence number is invalid. sequenceNumber = "
|
||||
+ newSequenceNumber + " / storedSequenceNumber=" + storedSequenceNumber + "\n" +
|
||||
|
@ -101,7 +101,7 @@ public final class MailboxStoragePayload implements StoragePayload {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ExpirableMailboxPayload{" +
|
||||
return "MailboxStoragePayload{" +
|
||||
"prefixedSealedAndSignedMessage=" + prefixedSealedAndSignedMessage +
|
||||
", senderStoragePublicKey.hashCode()=" + senderPubKeyForAddOperation.hashCode() +
|
||||
", receiverStoragePublicKey.hashCode()=" + receiverPubKeyForRemoveOperation.hashCode() +
|
||||
|
@ -69,7 +69,7 @@ public class ProtectedStorageEntry implements Payload {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ProtectedData{" +
|
||||
return "ProtectedStorageEntry{" +
|
||||
"expirablePayload=" + storagePayload +
|
||||
", timeStamp=" + timeStamp +
|
||||
", sequenceNumber=" + sequenceNumber +
|
||||
|
Loading…
Reference in New Issue
Block a user