Message: replace readBytes(1)[0] with readByte()

This commit is contained in:
Andreas Schildbach 2023-03-22 21:39:05 +01:00
parent 89198853d1
commit 30dec4ff7c
3 changed files with 3 additions and 3 deletions

View file

@ -155,7 +155,7 @@ public class BloomFilter extends Message {
if (hashFuncs > MAX_HASH_FUNCS) if (hashFuncs > MAX_HASH_FUNCS)
throw new ProtocolException("Bloom filter hash function count out of range"); throw new ProtocolException("Bloom filter hash function count out of range");
nTweak = readUint32(); nTweak = readUint32();
nFlags = readBytes(1)[0]; nFlags = readByte();
} }
/** /**

View file

@ -96,7 +96,7 @@ public class RejectMessage extends Message {
@Override @Override
protected void parse() throws ProtocolException { protected void parse() throws ProtocolException {
message = readStr(); message = readStr();
code = RejectCode.fromCode(readBytes(1)[0]); code = RejectCode.fromCode(readByte());
reason = readStr(); reason = readStr();
if (message.equals("block") || message.equals("tx")) if (message.equals("block") || message.equals("tx"))
messageHash = readHash(); messageHash = readHash();

View file

@ -144,7 +144,7 @@ public class VersionMessage extends Message {
// int bestHeight (size of known block chain). // int bestHeight (size of known block chain).
bestHeight = readUint32(); bestHeight = readUint32();
if (clientVersion >= params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.BLOOM_FILTER)) { if (clientVersion >= params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.BLOOM_FILTER)) {
relayTxesBeforeFilter = readBytes(1)[0] != 0; relayTxesBeforeFilter = readByte() != 0;
} else { } else {
relayTxesBeforeFilter = true; relayTxesBeforeFilter = true;
} }