Mise à jour de GitLab prévue ce samedi 8 mai 2021 à partir de 9h00 CET | GitLab upgrade planned this Saturday May 4th of 2021 from 9:00 AM CET

Commit a6ae8156 authored by Cédric Moreau's avatar Cédric Moreau

Fix: impact on Date & ConfirmedDate of Block document

parent 4c68fc53
......@@ -59,7 +59,7 @@ MembershipSchema.methods = {
},
inline: function() {
return [this.issuer, this.signature, this.date.timestamp()].join(':');
return [this.issuer, this.signature, this.date.timestamp(), this.certts.timestamp(), this.userid].join(':');
},
inlineValue: function() {
......
......@@ -1052,6 +1052,7 @@ function BlockchainService (conn, conf, IdentityService, PeeringService) {
block.version = 1;
block.currency = current ? current.currency : conf.currency;
block.number = current ? current.number + 1 : 0;
block.confirmedDate = current ? current.confirmedDate : moment.utc().startOf('day').unix();
block.previousHash = current ? current.hash : "";
block.previousIssuer = current ? current.issuer : "";
// Members merkle
......@@ -1173,12 +1174,12 @@ function BlockchainService (conn, conf, IdentityService, PeeringService) {
async.whilst(
function(){ return !pow.match(powRegexp); },
function (next) {
var newTS = new Date().utcZero().timestamp();
if (newTS == block.timestamp) {
var newTS = moment.utc().startOf('day').unix();
if (newTS == block.date) {
block.nonce++;
} else {
block.nonce = 0;
block.timestamp = newTS;
block.date = newTS;
}
raw = block.getRaw();
sigFunc(raw, function (err, sigResult) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment