-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
statedb: Add checks to see if table is registered
If a user forgets to register a table with the DB instance and then proceeds to use it, the tablePos defaults to 0. This causes writes to the table to end up in the wrong table. This commit defaults the table pos to -1 to cause deliberate panics if the code ever attempts to use the index of a unregistered table. This commit also adds checks on the read and write transactions to detect when an unregistered table is being used and throw a clear error. Signed-off-by: Dylan Reimerink <[email protected]>
- Loading branch information
1 parent
dc95f9b
commit 475849f
Showing
4 changed files
with
11 additions
and
0 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