mempoolentry: improve serialization.
This commit is contained in:
parent
7ccea6fbb8
commit
3ac91b9a77
@ -195,7 +195,7 @@ MempoolEntry.prototype.isFree = function isFree(height) {
|
||||
*/
|
||||
|
||||
MempoolEntry.prototype.getSize = function getSize() {
|
||||
return this.tx.getSize() + 37;
|
||||
return this.tx.getSize() + 49;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -212,8 +212,10 @@ MempoolEntry.prototype.toRaw = function toRaw() {
|
||||
bw.writeDouble(this.priority);
|
||||
bw.writeU32(this.fee);
|
||||
bw.writeU32(this.ts);
|
||||
bw.write64(this.value);
|
||||
bw.writeU64(this.value);
|
||||
bw.writeU8(this.dependencies ? 1 : 0);
|
||||
bw.writeU64(this.descFee);
|
||||
bw.writeU32(this.descSize);
|
||||
return bw.render();
|
||||
};
|
||||
|
||||
@ -233,8 +235,10 @@ MempoolEntry.prototype.fromRaw = function fromRaw(data) {
|
||||
this.priority = br.readDouble();
|
||||
this.fee = br.readU32();
|
||||
this.ts = br.readU32();
|
||||
this.value = br.read64();
|
||||
this.value = br.readU64();
|
||||
this.dependencies = br.readU8() === 1;
|
||||
this.descFee = br.readU64();
|
||||
this.descSize = br.readU32();
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user