chain: fix getProofTime.
This commit is contained in:
parent
71f8b25d3c
commit
fb8b9fac2b
@ -1928,6 +1928,7 @@ Chain.prototype.getOrphanRoot = function getOrphanRoot(hash) {
|
||||
*/
|
||||
|
||||
Chain.prototype.getProofTime = function getProofTime(to, from) {
|
||||
var pow = this.network.pow;
|
||||
var sign, work;
|
||||
|
||||
if (to.chainwork.cmp(from.chainwork) > 0) {
|
||||
@ -1938,8 +1939,8 @@ Chain.prototype.getProofTime = function getProofTime(to, from) {
|
||||
sign = -1;
|
||||
}
|
||||
|
||||
work = work.imuln(this.network.pow.targetSpacing);
|
||||
work = work.idiv(this.tip.getProof());
|
||||
work = work.imuln(pow.targetSpacing);
|
||||
work = work.div(this.tip.getProof());
|
||||
|
||||
if (work.bitLength() > 53)
|
||||
return sign * util.MAX_SAFE_INTEGER;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user