Skip to content

Commit 585eec1

Browse files
committed
remove config mix.maxClients + remove idle threads
1 parent d95f5ef commit 585eec1

File tree

4 files changed

+13
-62
lines changed

4 files changed

+13
-62
lines changed

app/components/MixStatus/index.js

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ class MixStatus extends React.PureComponent {
2222
</div>
2323
<div className='col-sm-10 mixThreads'>
2424
<div className='row no-gutters justify-content-center'>
25-
{mixService.getThreadsAndIdle().map((utxo,i) => {
26-
let content
27-
if (utxo !== undefined) {
25+
{mixService.getThreads().map((utxo,i) => {
2826
const pool = poolsService.findPool(utxo.poolId)
2927
const poolInfo = pool ? <small>{pool.nbConfirmed}/{pool.mixAnonymitySet} peers</small> : undefined
3028
const message = utils.utxoMessage(utxo)
@@ -36,32 +34,20 @@ class MixStatus extends React.PureComponent {
3634
const progressVariant = utxo.progressPercent ? undefined : 'info'
3735
const poolProgress = pool ? (100 - progressPercent) * poolsService.computePoolProgress(pool) / 100 : undefined
3836

39-
content = <div>
40-
<div className='label'
41-
title={utxo.hash + ':' + utxo.index + ' (' + utxo.account + ') (' + mixService.computeLastActivity(utxo) + ')'}>{progressLabel}</div>
42-
<ProgressBar>
43-
<ProgressBar animated now={progressPercent} variant={progressVariant} key={1}
44-
className={'progressBarSamourai'+(utxo.mixStep === 'CONNECTING'?' connecting':'')}/>
45-
{poolProgress && <ProgressBar variant="warning" now={poolProgress} key={2}/>}
46-
</ProgressBar>
47-
</div>
48-
} else {
49-
content = <div>
50-
<div className='label'>
51-
<strong>THREAD {(i+1)}</strong><br/>
52-
<small>idle</small>
53-
</div>
54-
<ProgressBar animated now={0} className={'progressBarSamourai'}/>
55-
</div>
56-
}
57-
return <div className='col-sm-3 align-self-center' key={i}>
58-
<div className='row no-gutters'>
59-
<div className='col-sm-12 item'>
60-
{content}
37+
return <div className='col-sm-3 align-self-center' key={i}>
38+
<div className='row no-gutters'>
39+
<div className='col-sm-12 item'>
40+
<div className='label'
41+
title={utxo.hash + ':' + utxo.index + ' (' + utxo.account + ') (' + mixService.computeLastActivity(utxo) + ')'}>{progressLabel}</div>
42+
<ProgressBar>
43+
<ProgressBar animated now={progressPercent} variant={progressVariant} key={1}
44+
className={'progressBarSamourai' + (utxo.mixStep === 'CONNECTING' ? ' connecting' : '')}/>
45+
{poolProgress != undefined && <ProgressBar variant="warning" now={poolProgress} key={2}/>}
46+
</ProgressBar>
47+
</div>
6148
</div>
6249
</div>
63-
</div>
64-
})}
50+
})}
6551
</div>
6652
</div>
6753
<div className='col-sm-1 mixStatus align-self-center text-center'>

app/containers/ConfigPage.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -215,19 +215,6 @@ export default class ConfigPage extends Component<Props> {
215215
</div>
216216
</div>
217217

218-
<div className="form-group row">
219-
<label htmlFor="clients" className="col-sm-2 col-form-label">Max clients</label>
220-
<div className="col-sm-10">
221-
<div className='row'>
222-
<input type="number" className='form-control col-sm-1' onChange={e => {
223-
const myValue = parseInt(e.target.value)
224-
myThis.onChangeCliConfig(cliConfig => cliConfig.mix.clients = myValue)
225-
}} defaultValue={cliConfig.mix.clients} id="clients"/>
226-
<label className='col-form-label col-sm-11'>Max simultaneous mixing clients</label>
227-
</div>
228-
</div>
229-
</div>
230-
231218
{clientsPerPoolEditable && <div className="form-group row">
232219
<label htmlFor="clientsPerPool" className="col-sm-2 col-form-label">Max clients per pool</label>
233220
<div className="col-sm-10">

app/reducers/mix.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ const initialState = {
77
/*mix: {
88
started: false,
99
nbMixing: 0,
10-
maxClients: 0,
11-
nbIdle:0,
1210
nbQueued:0,
1311
threads: []
1412
}*/

app/services/mixService.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,6 @@ class MixService {
131131
return this.state.mix.nbMixing;
132132
}
133133

134-
getMaxClients() {
135-
return this.state.mix.maxClients;
136-
}
137-
138-
getNbIdle() {
139-
return this.state.mix.nbIdle;
140-
}
141-
142134
getNbQueued() {
143135
return this.state.mix.nbQueued;
144136
}
@@ -147,18 +139,6 @@ class MixService {
147139
return this.state.mix.threads;
148140
}
149141

150-
getThreadsAndIdle() {
151-
const threadsWithIdle = []
152-
for (const i in this.state.mix.threads) {
153-
const thread = this.state.mix.threads[i]
154-
threadsWithIdle[threadsWithIdle.length] = thread
155-
}
156-
for (let i = 0; i < this.getNbIdle(); i++) {
157-
threadsWithIdle[threadsWithIdle.length] = undefined
158-
}
159-
return threadsWithIdle;
160-
}
161-
162142
fetchState () {
163143
return ifNot.run('mixService:fetchState', () => {
164144
// fetchState backend

0 commit comments

Comments
 (0)