Wrap exceptions thrown during dividend payouts to add extra info
for debugging
This commit is contained in:
parent
5b771c3a28
commit
ed9cdd96ec
1 changed files with 118 additions and 114 deletions
|
|
@ -737,7 +737,7 @@ void schedule_pending_dividend_balances(database& db,
|
||||||
const vesting_balance_index& vesting_index,
|
const vesting_balance_index& vesting_index,
|
||||||
const total_distributed_dividend_balance_object_index& distributed_dividend_balance_index,
|
const total_distributed_dividend_balance_object_index& distributed_dividend_balance_index,
|
||||||
const pending_dividend_payout_balance_for_holder_object_index& pending_payout_balance_index)
|
const pending_dividend_payout_balance_for_holder_object_index& pending_payout_balance_index)
|
||||||
{
|
{ try {
|
||||||
dlog("Processing dividend payments for dividend holder asset type ${holder_asset} at time ${t}",
|
dlog("Processing dividend payments for dividend holder asset type ${holder_asset} at time ${t}",
|
||||||
("holder_asset", dividend_holder_asset_obj.symbol)("t", db.head_block_time()));
|
("holder_asset", dividend_holder_asset_obj.symbol)("t", db.head_block_time()));
|
||||||
auto current_distribution_account_balance_range =
|
auto current_distribution_account_balance_range =
|
||||||
|
|
@ -1059,10 +1059,10 @@ void schedule_pending_dividend_balances(database& db,
|
||||||
dividend_data_obj.last_distribution_time = current_head_block_time;
|
dividend_data_obj.last_distribution_time = current_head_block_time;
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
} FC_CAPTURE_AND_RETHROW() }
|
||||||
|
|
||||||
void process_dividend_assets(database& db)
|
void process_dividend_assets(database& db)
|
||||||
{
|
{ try {
|
||||||
ilog("In process_dividend_assets time ${time}", ("time", db.head_block_time()));
|
ilog("In process_dividend_assets time ${time}", ("time", db.head_block_time()));
|
||||||
|
|
||||||
const account_balance_index& balance_index = db.get_index_type<account_balance_index>();
|
const account_balance_index& balance_index = db.get_index_type<account_balance_index>();
|
||||||
|
|
@ -1083,6 +1083,8 @@ void process_dividend_assets(database& db)
|
||||||
balance_index, vbalance_index, distributed_dividend_balance_index, pending_payout_balance_index);
|
balance_index, vbalance_index, distributed_dividend_balance_index, pending_payout_balance_index);
|
||||||
if (dividend_data.options.next_payout_time &&
|
if (dividend_data.options.next_payout_time &&
|
||||||
db.head_block_time() >= *dividend_data.options.next_payout_time)
|
db.head_block_time() >= *dividend_data.options.next_payout_time)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
dlog("Dividend payout time has arrived for asset ${holder_asset}",
|
dlog("Dividend payout time has arrived for asset ${holder_asset}",
|
||||||
("holder_asset", dividend_holder_asset_obj.symbol));
|
("holder_asset", dividend_holder_asset_obj.symbol));
|
||||||
|
|
@ -1216,11 +1218,13 @@ void process_dividend_assets(database& db)
|
||||||
(dividend_data_obj.options.next_payout_time));
|
(dividend_data_obj.options.next_payout_time));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
FC_RETHROW_EXCEPTIONS(error, "Error while paying out dividends for holder asset ${holder_asset}", ("holder_asset", dividend_holder_asset_obj.symbol))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} FC_CAPTURE_AND_RETHROW() }
|
||||||
|
|
||||||
void database::perform_chain_maintenance(const signed_block& next_block, const global_property_object& global_props)
|
void database::perform_chain_maintenance(const signed_block& next_block, const global_property_object& global_props)
|
||||||
{
|
{ try {
|
||||||
const auto& gpo = get_global_properties();
|
const auto& gpo = get_global_properties();
|
||||||
|
|
||||||
distribute_fba_balances(*this);
|
distribute_fba_balances(*this);
|
||||||
|
|
@ -1416,6 +1420,6 @@ void database::perform_chain_maintenance(const signed_block& next_block, const g
|
||||||
// process_budget needs to run at the bottom because
|
// process_budget needs to run at the bottom because
|
||||||
// it needs to know the next_maintenance_time
|
// it needs to know the next_maintenance_time
|
||||||
process_budget();
|
process_budget();
|
||||||
}
|
} FC_CAPTURE_AND_RETHROW() }
|
||||||
|
|
||||||
} }
|
} }
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue