Workaround CQ spent bug

This commit is contained in:
Thomas Zarebczan 2020-12-21 15:42:55 -05:00
parent a09216da76
commit 9a5d0954df
No known key found for this signature in database
GPG key ID: D505010BDB4364BC

View file

@ -31,7 +31,7 @@ module.exports.getClaim = async function getClaim(claimName, claimId, channelNam
'FROM claim ' + 'FROM claim ' +
'LEFT JOIN claim channel_claim on claim.publisher_id = channel_claim.claim_id ' + 'LEFT JOIN claim channel_claim on claim.publisher_id = channel_claim.claim_id ' +
'LEFT JOIN claim as reposted_claim on reposted_claim.claim_id = claim.claim_reference ' + 'LEFT JOIN claim as reposted_claim on reposted_claim.claim_id = claim.claim_reference ' +
'AND (reposted_claim.bid_state="controlling" OR reposted_claim.bid_state="active")' + 'AND (reposted_claim.bid_state in ("controlling", "active", "accepted", "spent") ' +
'LEFT JOIN claim as repost_channel on repost_channel.claim_id = reposted_claim.publisher_id ' + 'LEFT JOIN claim as repost_channel on repost_channel.claim_id = reposted_claim.publisher_id ' +
'WHERE claim.name = ?'; 'WHERE claim.name = ?';
@ -40,7 +40,7 @@ module.exports.getClaim = async function getClaim(claimName, claimId, channelNam
params.push(claimId + '%'); params.push(claimId + '%');
} }
sql += ' AND claim.bid_state in ("controlling", "active", "accepted")'; sql += ' AND claim.bid_state in ("controlling", "active", "accepted", "spent")';
if (claimName[0] !== '@' && channelName) { if (claimName[0] !== '@' && channelName) {
sql += ' AND channel_claim.name = ?'; sql += ' AND channel_claim.name = ?';
@ -49,7 +49,7 @@ module.exports.getClaim = async function getClaim(claimName, claimId, channelNam
sql += ' AND channel_claim.claim_id LIKE ?'; sql += ' AND channel_claim.claim_id LIKE ?';
params.push(channelClaimId + '%'); params.push(channelClaimId + '%');
} else { } else {
sql += ' AND channel_claim.bid_state in ("controlling", "active", "accepted")'; sql += ' AND channel_claim.bid_state in ("controlling", "active", "accepted", "spent")';
} }
} }