Calculate the extra floData size to add to the Buffer when initializing
This commit is contained in:
parent
57e88d7762
commit
8024b466e9
@ -719,7 +719,16 @@ class TX {
|
||||
}
|
||||
}
|
||||
|
||||
const size = 156 + prev.getVarSize();
|
||||
// Calculate the extra floData size to add to the Buffer when initializing
|
||||
let extraFloDataSize = 0
|
||||
if (this.version >= 2 && includeFloData){
|
||||
let bufferLength = this.floData.length;
|
||||
|
||||
extraFloDataSize += encoding.sizeVarint(bufferLength);
|
||||
extraFloDataSize += bufferLength
|
||||
}
|
||||
|
||||
const size = 156 + prev.getVarSize() + extraFloDataSize;
|
||||
const bw = bio.pool(size);
|
||||
|
||||
bw.writeU32(this.version);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user