Enhancement: fork and high utxos detection #75
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
RPC FORK DETECTION
How to use it:
How it works
Decrements the index passed as arg to the height of active chain
Gets current hash
Gets hash of the same block using API: https://explorer.decenomy.net/api/v2/
Compares with hash returned from API
Outputs the result in the following format:
{
"nHeight": 1495956,
"remoteBlockhash": "4b19d312ace7e412b5d65d57d1cc7fa9d96597b447181e89b53b21466cdcc697",
"localBlockhash": "4b19d312ace7e412b5d65d57d1cc7fa9d96597b447181e89b53b21466cdcc697",
"requestSucceed": true,
"fForkDetected": "false"
}
RPC HIGH UTXOS DETECTION
How to use it:
How it works
Checks the number of utxos on wallet
Outputs the result in the following format:
{
"fHighUtxos": true,
"nUTxos": 76,
"nSpendable": 76,
"nSolvable": 76
}
UI FORK WARN
At each processed block checks if a fork was detected.
Shows a red icon on TopBar indicating the issue.
Allows a wallet rewind from the block in each the fork was detected.
Restarts the wallet if the user wants the rewind the blockchain
UI HIGHUTXOS WARN
At each processed block checks if the user has high utxos.
Shows a yellow icon on TopBar indicating the issue.
On click, asks the user if he wants to autocombine the utxos.
Enables stake and asks the user to unlock the wallet if needed.