Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions libraries/chain/util/dhf_processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,14 @@ void dhf_processor::transfer_payments( const time_point_sec& head_time, HBD_asse
period_pay = HBD_asset( fc::uint128_to_int64( ratio * _item.daily_pay.amount.value ) / HIVE_100_PERCENT );
}

if( db.has_hardfork( HIVE_HARDFORK_1_30_SCALE_DHF_PAYOUT_BY_HBD_PRINT_RATE ) )
{
const auto& gpo = db.get_dynamic_global_properties();
period_pay.amount = ( period_pay.amount * gpo.get_hbd_print_rate() ) / HIVE_100_PERCENT;
if( period_pay.amount <= 0 )
continue;
}

if( period_pay >= maintenance_budget_limit )
{
processing( _item, maintenance_budget_limit );
Expand Down
20 changes: 20 additions & 0 deletions libraries/protocol/hardfork.d/1_30.hf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#ifndef HIVE_HARDFORK_1_30
#define HIVE_HARDFORK_1_30 30

// Far-future default so HF30 never auto-activates on testnets that don't explicitly
// schedule it. Tests that exercise HF30 behavior must either (a) include HF30 in their
// alternate-chain-spec hardfork_schedule, or (b) use inject_hardfork() to activate it.
// 4102444800 = 2100-01-01T00:00:00Z
#define HIVE_HARDFORK_1_30_DEFAULT_TIME 4102444800L

#ifdef USE_ALTERNATE_CHAIN_ID
#define HIVE_HARDFORK_1_30_TIME (hive::protocol::testnet_blockchain_configuration::configuration_data.get_hf_time(HIVE_HARDFORK_1_30, HIVE_HARDFORK_1_30_DEFAULT_TIME))
#else
#define HIVE_HARDFORK_1_30_TIME HIVE_HARDFORK_1_30_DEFAULT_TIME
#endif

#define HIVE_HARDFORK_1_30_VERSION hive::protocol::hardfork_version( 1, 30 )

// scale DHF proposal payouts by hbd_print_rate during HBD debt stress
#define HIVE_HARDFORK_1_30_SCALE_DHF_PAYOUT_BY_HBD_PRINT_RATE (HIVE_HARDFORK_1_30)
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@
#define HIVE_HARDFORK_1_27_BLOCK 69050084
#define HIVE_HARDFORK_1_28_BLOCK 101319928
#define HIVE_HARDFORK_1_29_BLOCK 150000000
#define HIVE_HARDFORK_1_30_BLOCK 150000001