add time to block for sorting
This commit is contained in:
parent
451b24d4a8
commit
6de5bf3566
|
@ -22,6 +22,7 @@ var BlockSchema = new Schema({
|
|||
index: true,
|
||||
unique: true,
|
||||
},
|
||||
time: Number,
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ function spec(b) {
|
|||
return this.getNextBlock(genesisHash, cb);
|
||||
|
||||
|
||||
Block.findOne({}, {}, { sort: { 'confirmations' : 1 } }, function(err, block) {
|
||||
Block.findOne({}, {}, { sort: { 'time' : -1 } }, function(err, block) {
|
||||
if (err) return cb(err);
|
||||
|
||||
var nextHash =
|
||||
|
|
Loading…
Reference in New Issue