mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-01-30 23:02:15 +00:00
Refactor version constants a bit.
Resolves issue 206.
This commit is contained in:
parent
eae775a4bf
commit
0c1d308b5b
@ -72,6 +72,11 @@ public class VersionMessage extends Message {
|
||||
*/
|
||||
public boolean relayTxesBeforeFilter;
|
||||
|
||||
/** The version of this library release, as a string. */
|
||||
public static final String BITCOINJ_VERSION = "0.7-SNAPSHOT";
|
||||
/** The value that is prepended to the subVer field of this application. */
|
||||
public static final String LIBRARY_SUBVER = "/BitCoinJ:" + BITCOINJ_VERSION + "/";
|
||||
|
||||
public VersionMessage(NetworkParameters params, byte[] msg) throws ProtocolException {
|
||||
super(params, msg, 0);
|
||||
}
|
||||
@ -101,7 +106,7 @@ public class VersionMessage extends Message {
|
||||
} catch (UnknownHostException e) {
|
||||
throw new RuntimeException(e); // Cannot happen (illegal IP length).
|
||||
}
|
||||
subVer = "/BitCoinJ:0.7-SNAPSHOT/";
|
||||
subVer = LIBRARY_SUBVER;
|
||||
bestHeight = newBestHeight;
|
||||
this.relayTxesBeforeFilter = relayTxesBeforeFilter;
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
package com.google.bitcoin.core;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.spongycastle.util.encoders.Hex;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class VersionMessageTest {
|
||||
@Test
|
||||
// Test that we can decode version messages which miss data which some old nodes may not include
|
||||
|
Loading…
Reference in New Issue
Block a user