return default block height of 100000 #577

Merged
daovist merged 2 commits from default-block-height into master 2018-08-15 22:33:26 +02:00
2 changed files with 15 additions and 3 deletions

View file

@ -44,7 +44,8 @@ const publish = (publishParams, fileName, fileType) => {
})
.then(([fileRecord, claimRecord]) => {
// upsert the records
const {name, claim_id: claimId} = publishParams;
const {name} = publishParams;
const {claim_id: claimId} = publishResults;
const upsertCriteria = {
name,
claimId,

View file

@ -403,8 +403,19 @@ module.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, DECIMAL }) => {
};
Claim.getCurrentHeight = function () {
return this
.max('height');
return new Promise((resolve, reject) => {
return this
.max('height')
.then(result => {
if (result) {
return resolve(result);
}
return resolve(100000);
})
.catch(error => {
return reject(error);
});
});
};
return Claim;