mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-06-14 01:52:54 -04:00
Wrap PeerAddress into Peer, Make TomP2P Serializable
This commit is contained in:
parent
942284480f
commit
ae3a2e5bc6
2 changed files with 6 additions and 2 deletions
|
@ -363,7 +363,7 @@ public class P2PNode {
|
||||||
|
|
||||||
private FuturePut storePeerAddress() throws IOException {
|
private FuturePut storePeerAddress() throws IOException {
|
||||||
Number160 locationKey = Utils.makeSHAHash(keyPair.getPublic().getEncoded());
|
Number160 locationKey = Utils.makeSHAHash(keyPair.getPublic().getEncoded());
|
||||||
Data data = new Data(peerDHT.peerAddress());
|
Data data = new Data(new TomP2PPeer(peerDHT.peerAddress()));
|
||||||
log.debug("storePeerAddress " + peerDHT.peerAddress().toString());
|
log.debug("storePeerAddress " + peerDHT.peerAddress().toString());
|
||||||
return putDomainProtectedData(locationKey, data);
|
return putDomainProtectedData(locationKey, data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,8 @@ import io.bitsquare.network.Peer;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
import net.tomp2p.peers.PeerAddress;
|
import net.tomp2p.peers.PeerAddress;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -28,7 +30,9 @@ import net.tomp2p.peers.PeerAddress;
|
||||||
*
|
*
|
||||||
* @author Chris Beams
|
* @author Chris Beams
|
||||||
*/
|
*/
|
||||||
public class TomP2PPeer implements Peer {
|
public class TomP2PPeer implements Peer, Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -2022551056208230853L;
|
||||||
|
|
||||||
private final PeerAddress peerAddress;
|
private final PeerAddress peerAddress;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue