-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
client/dcr: Mixing Tx History #2853
Conversation
client/asset/dcr/dcr.go
Outdated
previouslySynced := dcr.previouslySynced.Load() | ||
if err != nil { | ||
dcr.previouslySynced.Store(false) | ||
return | ||
} | ||
dcr.previouslySynced.Store(synced) | ||
|
||
if !previouslySynced && synced { | ||
dcr.tipMtx.RLock() | ||
tip := dcr.currentTip | ||
dcr.tipMtx.RUnlock() | ||
|
||
dcr.syncTxHistory(dcr.ctx, uint64(tip.height)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little bit cleaner, I think
if wasSynced := dcr.previouslySynced.Swap(synced); synced && !wasSynced {
dcr.tipMtx.RLock()
tip := dcr.currentTip
dcr.tipMtx.RUnlock()
dcr.syncTxHistory(dcr.ctx, uint64(tip.height))
}
This diff handles identifying decred mixing transactions when adding them to the transaction history. Also, it updates the UI to allow hiding mixing transactions.
@@ -971,6 +974,7 @@ export default class WalletsPage extends BasePage { | |||
for (const b of assetSelect.children) b.classList.remove('selected') | |||
this.assetButtons[assetID].bttn.classList.add('selected') | |||
this.selectedAssetID = assetID | |||
this.page.hideMixTxsCheckbox.checked = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be remembered, but I'm not gonna push it now.
async getTxHistory (assetID: number, hideMixTxs: boolean, after?: string) : Promise<TxHistoryResult> { | ||
let numToFetch = 10 | ||
if (hideMixTxs) numToFetch = 15 | ||
|
||
const res : TxHistoryResult = { txs: [], lastTx: false } | ||
let ref = after | ||
|
||
for (let i = 0; i < 40; i++) { | ||
const currRes = await app().txHistory(assetID, numToFetch, ref) | ||
if (currRes.txs.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is kind of a hack. We should be passing a filter all the way in to the wallet.
* client/dcr: Mixing Tx History This diff handles identifying decred mixing transactions when adding them to the transaction history. Also, it updates the UI to allow hiding mixing transactions.
This diff handles identifying decred mixing transactions when adding them to the transaction history. For RPC wallets, a separate transaction history db is created for each set of unmixed/trading/mixed accounts configuration.
Closes #2824