add endTs to status
This commit is contained in:
parent
3db0ac8615
commit
b430742aa8
|
@ -91,6 +91,9 @@ function spec() {
|
||||||
return cb(err);
|
return cb(err);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
|
self.startTs = parseInt(Date.now()/1000);
|
||||||
|
|
||||||
// check testnet?
|
// check testnet?
|
||||||
self.rpc.getBlockHash(0, function(err, res){
|
self.rpc.getBlockHash(0, function(err, res){
|
||||||
if (!err && ( res && res.result !== self.genesis)) {
|
if (!err && ( res && res.result !== self.genesis)) {
|
||||||
|
@ -121,6 +124,8 @@ function spec() {
|
||||||
syncTipHash: this.sync.tip,
|
syncTipHash: this.sync.tip,
|
||||||
error: this.error,
|
error: this.error,
|
||||||
type: this.type,
|
type: this.type,
|
||||||
|
startTs: this.startTs,
|
||||||
|
endTs: this.endTs,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -199,6 +204,8 @@ function spec() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( self.found && self.syncedBlocks >= self.blockChainHeight ) {
|
if ( self.found && self.syncedBlocks >= self.blockChainHeight ) {
|
||||||
|
|
||||||
|
self.endTs = parseInt(Date.now()/1000);
|
||||||
self.status = 'finished';
|
self.status = 'finished';
|
||||||
p('DONE. Height: ' , self.syncedBlocks);
|
p('DONE. Height: ' , self.syncedBlocks);
|
||||||
return cb(err);
|
return cb(err);
|
||||||
|
@ -290,8 +297,11 @@ function spec() {
|
||||||
|
|
||||||
if (blockInfo && blockInfo.hash) {
|
if (blockInfo && blockInfo.hash) {
|
||||||
self.syncedBlocks++;
|
self.syncedBlocks++;
|
||||||
} else
|
}
|
||||||
|
else {
|
||||||
|
self.endTs = parseInt(Date.now()/1000);
|
||||||
self.status = 'finished';
|
self.status = 'finished';
|
||||||
|
}
|
||||||
|
|
||||||
return cb(err);
|
return cb(err);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue