-
Notifications
You must be signed in to change notification settings - Fork 575
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes rescanning wallet without --reset (#3654)
the logic of 'connectBlock' filters any account that does not have its 'head' equal to the previous block. this means that if we don't reset account heads during rescan nothing will happen. this is also true of rescanning using the '--from' flag. this flag lets users start the rescan at a particular sequence. however, if we don't set account heads to that sequence then scanning won't do anything. - removes the 'reset' option and always resets accounts - throws an error if the 'from' sequence is not in the chain or the header at that sequence is not on the main chain - sets account heads equal to the block header before the from sequence if it is not the genesis block
- Loading branch information
Showing
5 changed files
with
108 additions
and
23 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
30 changes: 30 additions & 0 deletions
30
ironfish/src/rpc/routes/wallet/__fixtures__/rescanAccount.test.ts.fixture
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,30 @@ | ||
{ | ||
"wallet/rescanAccount sets account head to one before the request.from sequence": [ | ||
{ | ||
"header": { | ||
"sequence": 2, | ||
"previousBlockHash": "AD35193FA159CFD7440A3DFDFBE7ACB720CB4A44A441AB933071E2B9EF5DE90B", | ||
"noteCommitment": { | ||
"type": "Buffer", | ||
"data": "base64:q3Sg5nq5F4FBDGLBQA82adp4zfSm46kPFbJUlcSDmAk=" | ||
}, | ||
"transactionCommitment": { | ||
"type": "Buffer", | ||
"data": "base64:maskm0r6USIh55DSh6onTCysP+MEpqPV0OYLIXgDy5g=" | ||
}, | ||
"target": "883423532389192164791648750371459257913741948437809479060803100646309888", | ||
"randomness": "0", | ||
"timestamp": 1678897392755, | ||
"graffiti": "0000000000000000000000000000000000000000000000000000000000000000", | ||
"noteSize": 4, | ||
"work": "0" | ||
}, | ||
"transactions": [ | ||
{ | ||
"type": "Buffer", | ||
"data": "base64:AQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGzKiP////8AAAAA9spIe9qq9XCnvXKM0mvzp6x81rA1rFKBY7C5UOsSdiOXc6SZeTXwV9RuWmzGZ56WmcQercJu3bMpHzN1TksuEAHV3GufHIgUaCIX++5VCtqvkztByn+s+faxBiJYo0hwOlmFkt0LV7Q4vKW5s8x+/pk+yicC03fVO/nMfsOfGL8DRg4+vKzg4l8iML3l+1elt9DxYyOWdihkpHtI/Bv4gTHMEyNhm5+H9MuOT5nwr2GWcSue36x/P4sXuKNGfJkUE8T0nhFzUDTRt1awmTUkbfUWuQ5pEhrrJofq3BRbHeci3dvUqhAP/do1gENe9+wv1fyQerLLFnkjd4I9pF1VGcLzUWNgltKH4GUBAuVEGFoevB8+iXtaqkOOcE5mMtInro+vJ6oq9jJWBZCbkvaRe9bM/MEh9W39Odc59cvRGN0CYrrTqRcyjEZbKvI7g0HFpVmQ7sKL4/j0ncNcmdRWBooqo8hBP4gMoGk7w7YkiiUVfVpSXCOZsnffo8qXQ/DhP3fACZt3mEaCzr9CqhJD5XFQ1CwewYkfADYyEJDG2GLp2w8VRh3niDlOVWnJCMmgEos/uXt1lfnpW+0/udyykx8aXssLWpPEniWEALNoE5ZFNhpTSJHkJUlyb24gRmlzaCBub3RlIGVuY3J5cHRpb24gbWluZXIga2V5MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwel9yFFdsdl1imMjiy6n8Ai6eSAP5QiSx3otK5gvWhpSfIarTiu0HNUY0Fwt+gcwiCFE4raymoKjb7BdUCyS8Bw==" | ||
} | ||
] | ||
} | ||
] | ||
} |
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