Merge pull request #577 from lbryio/default-block-height

return default block height of 100000
This commit is contained in:
Bill Bittner 2018-08-15 13:33:26 -07:00 committed by GitHub
commit 858a5db346
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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;