-
Notifications
You must be signed in to change notification settings - Fork 648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
extend debug_dump checks #928
Conversation
Question: does it make sense that this is called at the end of init_genesis?
Apparently it was intended that this function can be used in different places, e. g. at https://github.com/bitshares/bitshares-core/blob/master/libraries/chain/db_market.cpp#L47 . Adding genesis as a parameter would defeat that purpose. |
@pmconrad i think you are right, was not seeing the full picture. in this commit: a0f7560
|
libraries/chain/db_debug.cpp
Outdated
if( total_balances[asset_id_type()].value != core_asset_data.current_supply.value ) | ||
{ | ||
edump( (total_balances[asset_id_type()].value)(core_asset_data.current_supply.value )); | ||
exit(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't call exit(). Better throw. (And if you do call exit, use a non-zero exit value to indicate an error. But don't call it.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed it, thanks.
libraries/chain/db_debug.cpp
Outdated
@@ -96,7 +96,7 @@ void database::debug_dump() | |||
if( total_balances[asset_id_type()].value != core_asset_data.current_supply.value ) | |||
{ | |||
edump( (total_balances[asset_id_type()].value)(core_asset_data.current_supply.value )); | |||
exit(0); | |||
throw; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh, at least use FC_THROW with an explanatory message. Perhaps I should have been more explicit. :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, changing now :)
for issue #136