Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Don't show moderators that have the wrong currency #764

Merged
merged 2 commits into from
Sep 7, 2017
Merged

Conversation

jjeffryes
Copy link
Contributor

This will check the currency accepted by a mod, and not show moderators that use the wrong currency (BTC vs. tBTC) for the network (mainnet vs. testnet).

@jjeffryes jjeffryes changed the title Don't show moderators that have the wrong currency [WIP] Don't show moderators that have the wrong currency Sep 7, 2017
@@ -61,8 +61,11 @@ export default class extends Collection {
// don't add excluded ids or your own id
const notExcluded = excludeList.indexOf(mod.id) === -1 && mod.id !== app.profile.id;
// don't add if not a mod or the mod data is missing
// don't add if the currency doesn't match the network
const cur = !!app.serverConfig.testnet ? 'tBTC' : 'BTC';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use app.serverConfig.cryptoCurrency to determine the currency as opposed to the testnet flag? That would make it more robust once we start handling other crypto currency values.

@@ -98,7 +98,16 @@ export default class extends baseVw {
// don't add profiles that are not moderators. The ID list may have peerIDs
// that are out of date, and are no longer moderators.
if (eventData.profile.moderator && eventData.profile.moderatorInfo) {
this.moderatorsCol.add(eventData.profile);
// if the moderator has an invalid currency, remove them from the list
const buyerCur = !!app.serverConfig.testnet ? 'tBTC' : 'BTC';
Copy link
Contributor

@rmisio rmisio Sep 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above. Can we use app.serverConfig.cryptoCurrency?

FWIW, in my config, I'm seeing the TBTC as all caps. If you're seeing it in some cases come back as tBTC, we may need to uppercase it (and maybe log a bug asking the server to standardize it).

@rmisio rmisio merged commit a8d56eb into master Sep 7, 2017
@rmisio rmisio deleted the checkModCurrency branch September 7, 2017 22:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants