block size.
This commit is contained in:
parent
34341e8b50
commit
21cae4224c
@ -71,24 +71,24 @@ Block.prototype.getRaw = function getRaw() {
|
|||||||
return raw;
|
return raw;
|
||||||
};
|
};
|
||||||
|
|
||||||
Block.prototype.getVirtualSize = function getVirtualSize() {
|
Block.prototype.getVirtualSize = function getVirtualSize(force) {
|
||||||
var size, witnessSize, base;
|
var size, witnessSize, base;
|
||||||
|
|
||||||
size = this.getSize();
|
size = this.getSize(force);
|
||||||
witnessSize = this.getWitnessSize();
|
witnessSize = this.getWitnessSize(force);
|
||||||
base = size - witnessSize;
|
base = size - witnessSize;
|
||||||
|
|
||||||
return (base * 4 + witnessSize + 3) / 4 | 0;
|
return (base * 4 + witnessSize + 3) / 4 | 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
Block.prototype.getSize = function getSize() {
|
Block.prototype.getSize = function getSize(force) {
|
||||||
if (this._size == null)
|
if (force || this._size === 0)
|
||||||
this.getRaw();
|
this.getRaw();
|
||||||
return this._size;
|
return this._size;
|
||||||
};
|
};
|
||||||
|
|
||||||
Block.prototype.getWitnessSize = function getWitnessSize() {
|
Block.prototype.getWitnessSize = function getWitnessSize(force) {
|
||||||
if (this._witnessSize == null)
|
if (force || this._size === 0)
|
||||||
this.getRaw();
|
this.getRaw();
|
||||||
return this._witnessSize;
|
return this._witnessSize;
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user