-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wallet: add deep clean and backup wdb to setting
- Loading branch information
1 parent
e0b7a08
commit c951e99
Showing
9 changed files
with
162 additions
and
13,313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import React, {Component} from "react"; | ||
import MiniModal from "../../components/Modal/MiniModal"; | ||
import {Route, withRouter} from "react-router-dom"; | ||
import Checkbox from "../../components/Checkbox"; | ||
import Anchor from "../../components/Anchor"; | ||
import Alert from "../../components/Alert"; | ||
|
||
@withRouter | ||
export default class DeepCleanAndRescanModal extends Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
hasBackup: false, | ||
} | ||
} | ||
|
||
render() { | ||
const { hasBackup } = this.state; | ||
return ( | ||
<MiniModal | ||
closeRoute="/settings/wallet" | ||
title="Deep Clean + Rescan" | ||
centered | ||
> | ||
<Alert | ||
type="warning" | ||
> | ||
This action wipes out balance and transaction history in the wallet DB but retains key hashes and name maps. It should be used only if the wallet state has been corrupted by issues like the <Anchor href="https://github.com/handshake-org/hsd/issues/454">reserved name registration bug</Anchor> or the <Anchor href="https://github.com/handshake-org/hsd/pull/464">locked coins balance after FINALIZE bug</Anchor>. | ||
</Alert> | ||
<div className="interstitial-warning-modal__checkbox"> | ||
<Checkbox | ||
className="interstitial-warning-modal__checkbox-box" | ||
onChange={() => this.setState({ hasBackup: !hasBackup })} | ||
checked={hasBackup} | ||
/> | ||
<div className="interstitial-warning-modal__checkbox-label"> | ||
I have my recovery seed phrase backed up. | ||
</div> | ||
</div> | ||
<button | ||
className="settings__btn" | ||
onClick={async () => { | ||
if (!hasBackup) return; | ||
await walletClient.deepClean(); | ||
walletClient.rescan(0); | ||
this.props.history.push('/settings/wallet'); | ||
}} | ||
disabled={!hasBackup} | ||
> | ||
Deep Clean and Rescan | ||
</button> | ||
</MiniModal> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.