-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Write to scriptPubkeyByPath index table after addressByScriptPubkey
If scriptPubkeyByPath is written to before addressByScriptPubkey, there is a chance that the write to addressByScriptPubkey fails or is interrupted, causing the processor data to be incorrect (an index on data that was never written). This appears to the user as an infamous "Missing processor address...during initialization" error message. We hopefully fix the issue and error for good with this change. The change includes moving the write to scriptPubkeyByPath at the end of the `saveAddress` processor routine. We do this with a update variable which we declare at the start of the routine and define it only when the update to the scriptPubkeyByPath table is necessary. In addition to this, we reworked some of the control-flow of this routine and modified the conditions in the control-flow for better readability. It's important this code is maintainable and easy to reason about.
- Loading branch information
Showing
2 changed files
with
51 additions
and
21 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