forked from Qortal/qortal
Fixed bug which saved an incorrect peer address for a forwarded arbitrary signatures message.
This commit is contained in:
parent
fbe34015d4
commit
edfc8cfdc4
@ -395,7 +395,7 @@ public class ArbitraryDataManager extends Thread {
|
||||
if (existingEntry == null) {
|
||||
// We haven't got a record of this mapping yet, so add it
|
||||
LOGGER.debug("Adding arbitrary peer: {} for signature {}", peerAddress, Base58.encode(signature));
|
||||
ArbitraryPeerData arbitraryPeerData = new ArbitraryPeerData(signature, peer);
|
||||
ArbitraryPeerData arbitraryPeerData = new ArbitraryPeerData(signature, peerAddress);
|
||||
repository.discardChanges();
|
||||
if (!arbitraryPeerData.isPeerAddressValid()) {
|
||||
return;
|
||||
|
@ -29,6 +29,10 @@ public class ArbitraryPeerData {
|
||||
0, 0, 0L, 0L);
|
||||
}
|
||||
|
||||
public ArbitraryPeerData(byte[] signature, String peerAddress) {
|
||||
this(Crypto.digest(signature), peerAddress, 0, 0, 0L, 0L);
|
||||
}
|
||||
|
||||
public boolean isPeerAddressValid() {
|
||||
// Validate the peer address to prevent arbitrary values being added to the db
|
||||
String[] parts = this.peerAddress.split(":");
|
||||
|
Loading…
x
Reference in New Issue
Block a user