@@ -600,15 +600,14 @@ namespace steemit {
600600
601601 bool result;
602602 detail::with_skip_flags (*this , skip, [&]() {
603- detail::without_pending_transactions (*this , std::move (_pending_tx),
604- [&]() {
605- try {
606- with_write_lock ([&]() {
607- result = _push_block (new_block);
608- });
609- }
610- FC_CAPTURE_AND_RETHROW ((new_block))
611- });
603+ with_write_lock ([&]() {
604+ detail::without_pending_transactions (*this , std::move (_pending_tx), [&]() {
605+ try {
606+ result = _push_block (new_block);
607+ }
608+ FC_CAPTURE_AND_RETHROW ((new_block))
609+ });
610+ });
612611 });
613612
614613 // fc::time_point end_time = fc::time_point::now();
@@ -2315,7 +2314,8 @@ namespace steemit {
23152314 auto pay = std::max (percent, STEEMIT_MIN_PRODUCER_REWARD );
23162315
23172316 // / pay witness in vesting shares
2318- if (props.head_block_number >= STEEMIT_START_MINER_VOTING_BLOCK ||
2317+ if (props.head_block_number >=
2318+ STEEMIT_START_MINER_VOTING_BLOCK ||
23192319 (witness_account.vesting_shares .amount .value == 0 )) {
23202320 // const auto& witness_obj = get_witness( props.current_witness );
23212321 create_vesting (witness_account, pay);
@@ -2330,7 +2330,8 @@ namespace steemit {
23302330 auto pay = std::max (percent, STEEMIT_MIN_PRODUCER_REWARD_PRE_HF_16 );
23312331
23322332 // / pay witness in vesting shares
2333- if (props.head_block_number >= STEEMIT_START_MINER_VOTING_BLOCK ||
2333+ if (props.head_block_number >=
2334+ STEEMIT_START_MINER_VOTING_BLOCK ||
23342335 (witness_account.vesting_shares .amount .value == 0 )) {
23352336 // const auto& witness_obj = get_witness( props.current_witness );
23362337 create_vesting (witness_account, pay);
@@ -2371,8 +2372,9 @@ namespace steemit {
23712372
23722373 void database::pay_liquidity_reward () {
23732374#ifdef STEEMIT_BUILD_TESTNET
2374- if ( !liquidity_rewards_enabled )
2375- return ;
2375+ if (!liquidity_rewards_enabled) {
2376+ return ;
2377+ }
23762378#endif
23772379
23782380 if ((head_block_num () % STEEMIT_LIQUIDITY_REWARD_BLOCKS ) == 0 ) {
@@ -2922,9 +2924,11 @@ namespace steemit {
29222924
29232925
29242926 void database::validate_transaction (const signed_transaction &trx) {
2925- auto session = start_undo_session (true );
2926- _apply_transaction (trx);
2927- session.undo ();
2927+ database::with_write_lock ([&]() {
2928+ auto session = start_undo_session (true );
2929+ _apply_transaction (trx);
2930+ session.undo ();
2931+ });
29282932 }
29292933
29302934 void database::notify_changed_objects () {
@@ -3016,12 +3020,12 @@ namespace steemit {
30163020 x += now % span;
30173021 }
30183022 _next_flush_block = x;
3019- ilog (" Next flush scheduled at block ${b}" , (" b" , x));
3023+ // ilog("Next flush scheduled at block ${b}", ("b", x));
30203024 }
30213025
30223026 if (_next_flush_block == block_num) {
30233027 _next_flush_block = 0 ;
3024- ilog (" Flushing database shared memory at block ${b}" , (" b" , block_num));
3028+ // ilog("Flushing database shared memory at block ${b}", ("b", block_num));
30253029 chainbase::database::flush ();
30263030 }
30273031 }
@@ -3233,8 +3237,9 @@ namespace steemit {
32333237 fho.current_median_history = copy[copy.size () / 2 ];
32343238
32353239#ifdef STEEMIT_BUILD_TESTNET
3236- if ( skip_price_feed_limit_check )
3237- return ;
3240+ if (skip_price_feed_limit_check) {
3241+ return ;
3242+ }
32383243#endif
32393244 if (has_hardfork (STEEMIT_HARDFORK_0_14__230 )) {
32403245 const auto &gpo = get_dynamic_global_properties ();
@@ -4137,17 +4142,17 @@ namespace steemit {
41374142 case STEEMIT_HARDFORK_0_1 :
41384143 perform_vesting_share_split (10000 );
41394144#ifdef STEEMIT_BUILD_TESTNET
4140- {
4141- custom_operation test_op;
4142- string op_msg = " Testnet: Hardfork applied" ;
4143- test_op.data = vector< char >( op_msg.begin (), op_msg.end () );
4144- test_op.required_auths .insert ( STEEMIT_INIT_MINER_NAME );
4145- operation op = test_op; // we need the operation object to live to the end of this scope
4146- operation_notification note ( op );
4147- notify_pre_apply_operation ( note );
4148- notify_post_apply_operation ( note );
4149- }
4150- break ;
4145+ {
4146+ custom_operation test_op;
4147+ string op_msg = " Testnet: Hardfork applied" ;
4148+ test_op.data = vector<char >( op_msg.begin (), op_msg.end ());
4149+ test_op.required_auths .insert (STEEMIT_INIT_MINER_NAME );
4150+ operation op = test_op; // we need the operation object to live to the end of this scope
4151+ operation_notification note (op );
4152+ notify_pre_apply_operation (note);
4153+ notify_post_apply_operation (note);
4154+ }
4155+ break ;
41514156#endif
41524157 break ;
41534158 case STEEMIT_HARDFORK_0_2 :
@@ -4470,10 +4475,9 @@ namespace steemit {
44704475 if (itr->parent_author != STEEMIT_ROOT_POST_PARENT ) {
44714476// Low memory nodes only need immediate child count, full nodes track total children
44724477#ifdef IS_LOW_MEM
4473- modify ( get_comment ( itr->parent_author , itr->parent_permlink ), [&]( comment_object& c )
4474- {
4475- c.children ++;
4476- });
4478+ modify (get_comment (itr->parent_author , itr->parent_permlink ), [&](comment_object &c) {
4479+ c.children ++;
4480+ });
44774481#else
44784482 const comment_object *parent = &get_comment (itr->parent_author , itr->parent_permlink );
44794483 while (parent) {
@@ -4547,6 +4551,5 @@ namespace steemit {
45474551 }
45484552 }
45494553 }
4550-
45514554 }
45524555} // steemit::chain
0 commit comments