Merge pull request #577 from lbryio/default-block-height
return default block height of 100000
This commit is contained in:
commit
858a5db346
2 changed files with 15 additions and 3 deletions
|
@ -44,7 +44,8 @@ const publish = (publishParams, fileName, fileType) => {
|
||||||
})
|
})
|
||||||
.then(([fileRecord, claimRecord]) => {
|
.then(([fileRecord, claimRecord]) => {
|
||||||
// upsert the records
|
// upsert the records
|
||||||
const {name, claim_id: claimId} = publishParams;
|
const {name} = publishParams;
|
||||||
|
const {claim_id: claimId} = publishResults;
|
||||||
const upsertCriteria = {
|
const upsertCriteria = {
|
||||||
name,
|
name,
|
||||||
claimId,
|
claimId,
|
||||||
|
|
|
@ -403,8 +403,19 @@ module.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, DECIMAL }) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
Claim.getCurrentHeight = function () {
|
Claim.getCurrentHeight = function () {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
return this
|
return this
|
||||||
.max('height');
|
.max('height')
|
||||||
|
.then(result => {
|
||||||
|
if (result) {
|
||||||
|
return resolve(result);
|
||||||
|
}
|
||||||
|
return resolve(100000);
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
return reject(error);
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return Claim;
|
return Claim;
|
||||||
|
|
Loading…
Add table
Reference in a new issue