mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-06-29 17:17:19 -04:00
Renaming of storage messages, add comments
This commit is contained in:
parent
fa2da8dbe5
commit
3dbcfb650a
22 changed files with 241 additions and 182 deletions
|
@ -18,12 +18,12 @@
|
|||
package io.bitsquare.alert;
|
||||
|
||||
import io.bitsquare.app.Version;
|
||||
import io.bitsquare.p2p.storage.data.PubKeyProtectedExpirablePayload;
|
||||
import io.bitsquare.p2p.storage.data.StorageMessage;
|
||||
|
||||
import java.security.PublicKey;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public final class Alert implements PubKeyProtectedExpirablePayload {
|
||||
public final class Alert implements StorageMessage {
|
||||
// That object is sent over the wire, so we need to take care of version compatibility.
|
||||
private static final long serialVersionUID = Version.P2P_NETWORK_VERSION;
|
||||
|
||||
|
@ -54,7 +54,7 @@ public final class Alert implements PubKeyProtectedExpirablePayload {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PublicKey getPubKey() {
|
||||
public PublicKey getOwnerPubKey() {
|
||||
return storagePublicKey;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ public class AlertManager {
|
|||
alertService.addHashSetChangedListener(new HashMapChangedListener() {
|
||||
@Override
|
||||
public void onAdded(ProtectedData entry) {
|
||||
Serializable data = entry.expirablePayload;
|
||||
Serializable data = entry.expirableMessage;
|
||||
if (data instanceof Alert) {
|
||||
Alert alert = (Alert) data;
|
||||
if (verifySignature(alert))
|
||||
|
@ -72,7 +72,7 @@ public class AlertManager {
|
|||
|
||||
@Override
|
||||
public void onRemoved(ProtectedData entry) {
|
||||
Serializable data = entry.expirablePayload;
|
||||
Serializable data = entry.expirableMessage;
|
||||
if (data instanceof Alert) {
|
||||
Alert alert = (Alert) data;
|
||||
if (verifySignature(alert))
|
||||
|
|
|
@ -20,7 +20,7 @@ package io.bitsquare.arbitration;
|
|||
import io.bitsquare.app.Version;
|
||||
import io.bitsquare.common.crypto.PubKeyRing;
|
||||
import io.bitsquare.p2p.NodeAddress;
|
||||
import io.bitsquare.p2p.storage.data.PubKeyProtectedExpirablePayload;
|
||||
import io.bitsquare.p2p.storage.data.StorageMessage;
|
||||
|
||||
import java.security.PublicKey;
|
||||
import java.util.Arrays;
|
||||
|
@ -28,7 +28,7 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public final class Arbitrator implements PubKeyProtectedExpirablePayload {
|
||||
public final class Arbitrator implements StorageMessage {
|
||||
// That object is sent over the wire, so we need to take care of version compatibility.
|
||||
private static final long serialVersionUID = Version.P2P_NETWORK_VERSION;
|
||||
|
||||
|
@ -73,7 +73,7 @@ public final class Arbitrator implements PubKeyProtectedExpirablePayload {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PublicKey getPubKey() {
|
||||
public PublicKey getOwnerPubKey() {
|
||||
return pubKeyRing.getSignaturePubKey();
|
||||
}
|
||||
|
||||
|
|
|
@ -84,8 +84,8 @@ public class ArbitratorService {
|
|||
|
||||
public Map<NodeAddress, Arbitrator> getArbitrators() {
|
||||
Set<Arbitrator> arbitratorSet = p2PService.getDataMap().values().stream()
|
||||
.filter(e -> e.expirablePayload instanceof Arbitrator)
|
||||
.map(e -> (Arbitrator) e.expirablePayload)
|
||||
.filter(e -> e.expirableMessage instanceof Arbitrator)
|
||||
.map(e -> (Arbitrator) e.expirableMessage)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
Map<NodeAddress, Arbitrator> map = new HashMap<>();
|
||||
|
|
|
@ -25,7 +25,7 @@ import io.bitsquare.common.handlers.ResultHandler;
|
|||
import io.bitsquare.common.util.JsonExclude;
|
||||
import io.bitsquare.locale.Country;
|
||||
import io.bitsquare.p2p.NodeAddress;
|
||||
import io.bitsquare.p2p.storage.data.PubKeyProtectedExpirablePayload;
|
||||
import io.bitsquare.p2p.storage.data.StorageMessage;
|
||||
import io.bitsquare.payment.PaymentMethod;
|
||||
import io.bitsquare.trade.protocol.availability.OfferAvailabilityModel;
|
||||
import io.bitsquare.trade.protocol.availability.OfferAvailabilityProtocol;
|
||||
|
@ -46,7 +46,7 @@ import java.util.concurrent.TimeUnit;
|
|||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public final class Offer implements PubKeyProtectedExpirablePayload {
|
||||
public final class Offer implements StorageMessage {
|
||||
// That object is sent over the wire, so we need to take care of version compatibility.
|
||||
@JsonExclude
|
||||
private static final long serialVersionUID = Version.P2P_NETWORK_VERSION;
|
||||
|
@ -254,7 +254,7 @@ public final class Offer implements PubKeyProtectedExpirablePayload {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PublicKey getPubKey() {
|
||||
public PublicKey getOwnerPubKey() {
|
||||
return pubKeyRing.getSignaturePubKey();
|
||||
}
|
||||
|
||||
|
|
|
@ -85,8 +85,8 @@ public class OfferBookService {
|
|||
|
||||
public List<Offer> getOffers() {
|
||||
final List<Offer> offers = p2PService.getDataMap().values().stream()
|
||||
.filter(e -> e.expirablePayload instanceof Offer)
|
||||
.map(e -> (Offer) e.expirablePayload)
|
||||
.filter(e -> e.expirableMessage instanceof Offer)
|
||||
.map(e -> (Offer) e.expirableMessage)
|
||||
.collect(Collectors.toList());
|
||||
return offers;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue