What is SoftFork 0.22.2? A dive into the code
hive-169321·@cadawg·
0.000 HBDWhat is SoftFork 0.22.2? A dive into the code
SoftFork 0.22.2 confused me as much as it probably did the rest of you, I slept through the fork and so I was very confused, let's take a look into the code:
/* If the time of the current block is more than the target SoftFork time */
```
if ( fc::time_point_sec( STEEM_PROTECTION_HARDFORK_TIME ) <= head_block_time() )
{
```
Based on the kind of operation, block it if it's from a STEEMIT, Inc owned account and:
```
switch( op.which() )
{
```
It's a witness vote or proxy
```
case operation::tag<account_witness_proxy_operation>::value:
if ( hardforkprotect::get_steemit_accounts().count( op.get< account_witness_proxy_operation >().account ) )
FC_THROW_EXCEPTION(transaction_exception, "Error when pushing TX:\nReason: TX has been rejected.");
break;
case operation::tag<account_witness_vote_operation>::value:
if ( hardforkprotect::get_steemit_accounts().count( op.get< account_witness_vote_operation >().account ) )
FC_THROW_EXCEPTION(transaction_exception, "Error when pushing TX:\nReason: TX has been rejected.");
break;
case
```
It's a proposal vote
```
operation::tag<update_proposal_votes_operation>::value:
if ( hardforkprotect::get_steemit_accounts().count( op.get< update_proposal_votes_operation >().voter ) )
FC_THROW_EXCEPTION(transaction_exception, "Error when pushing TX:\nReason: TX has been rejected.");
break;
```
It's a post vote
```
case operation::tag<vote_operation>::value:
if ( hardforkprotect::get_steemit_accounts().count( op.get< vote_operation >().voter ) )
FC_THROW_EXCEPTION(transaction_exception, "Error when pushing TX:\nReason: TX has been rejected.");
break;
```
It's a powerdown (you can powerdown to other accounts)
```
case operation::tag<withdraw_vesting_operation>::value:
if ( hardforkprotect::get_steemit_accounts().count( op.get< withdraw_vesting_operation >().account ) )
FC_THROW_EXCEPTION(transaction_exception, "Error when pushing TX:\nReason: TX has been rejected.");
break;
```
Trying to set powerdown route (account to powerdown to)
```
case operation::tag<set_withdraw_vesting_route_operation>::value:
if ( hardforkprotect::get_steemit_accounts().count( op.get< set_withdraw_vesting_route_operation >().from_account ) )
FC_THROW_EXCEPTION(transaction_exception, "Error when pushing TX:\nReason: TX has been rejected.");
break;
```
Trying to do a plain-old transfer
```
case operation::tag<transfer_operation>::value:
if ( hardforkprotect::get_steemit_accounts().count( op.get< transfer_operation >().from ) )
FC_THROW_EXCEPTION(transaction_exception, "Error when pushing TX:\nReason: TX has been rejected.");
break;
```
Trying to make a market order
```
case operation::tag<limit_order_create_operation>::value:
if ( hardforkprotect::get_steemit_accounts().count( op.get< limit_order_create_operation >().owner ) )
FC_THROW_EXCEPTION(transaction_exception, "Error when pushing TX:\nReason: TX has been rejected.");
break;
case operation::tag<limit_order_create2_operation>::value:
if ( hardforkprotect::get_steemit_accounts().count( op.get< limit_order_create2_operation >().owner ) )
FC_THROW_EXCEPTION(transaction_exception, "Error when pushing TX:\nReason: TX has been rejected.");
break;
```
Powering up
```
case operation::tag<transfer_to_vesting_operation>::value:
if ( hardforkprotect::get_steemit_accounts().count( op.get< transfer_to_vesting_operation >().from ) )
FC_THROW_EXCEPTION(transaction_exception, "Error when pushing TX:\nReason: TX has been rejected.");
break;
```
Sending to savings
```
case operation::tag<transfer_to_savings_operation>::value:
if ( hardforkprotect::get_steemit_accounts().count( op.get< transfer_to_savings_operation >().from ) )
FC_THROW_EXCEPTION(transaction_exception, "Error when pushing TX:\nReason: TX has been rejected.");
break;
```
Using inbuilt escrow function of the chain to make a transfer
```
case operation::tag<escrow_transfer_operation>::value:
if ( hardforkprotect::get_steemit_accounts().count( op.get< escrow_transfer_operation >().from ) )
FC_THROW_EXCEPTION(transaction_exception, "Error when pushing TX:\nReason: TX has been rejected.");
break;
```
For any other transaction, allow (so long as all the other requirements are ok)
```
default:
break;
}
}
```
Hope this helps you to understand,
~ @CADawg👍 asshole, g10a, stmdev, theodosiskatq, coredump, dtrade, haxxdump, dalz1, captain.palnet, jk6276.leo, mindtrap-leo, spinvest-leo, investprosper, abh12345.leo, leovoter, jk6276.pal, exe8422, laissez-faire, dblogvoter, anomaly, techken, driptorchpress, otom, rollandthomas, statsexpert, kevinwong, mermaidvampire, rull14958, cavampire, plankton.token, florino, nealmcspadden, pixelfan, therabbitzone, stackin, zephalexia, immanuel94, definethedollar, abwasserrohr, skyroad, steem.craft, tanvirsadatripon, chrismadcboy2016, flyerchen, trentox, steemclub-uk, solairitas, actifitflyerchen, solairibot, qurator, roar2vote, martians, gregory-f, tinyhousecryptos, erikaflynn, voter002, che-shyr, qustodian, espoem, mangos, voter001, map10k, newhope, meetmysuperego, tobias-g, johndoer123, literaturkritik, dcooperation, german.news, plook, scottshots, sbi3, zainenn, randomkindness, nfaith, crazydaisy, mapxv, ph1102.pal, chireerocks.leo, contrabot, ew-and-patterns, coolbuddy, altonos, budwizard, fiftysixnorth, j85063, doneliseo, benadam, sharonomics, pavan26, myxeno, tabassumusheer, biox, singhlakhbir, zeromile, agrow, sadiyakhan069, arsd, dkatole, xias, anmolwadbudhe, majes.tytyty, blitzapi, brainpod, tziagan, showtime, plankton.bot, cadawg, digno, eva.bot, rarebooksleuth, moserich, steemitachievers, tshering-tamang, didic, camuel, ricolasco, powerupsteem, cn-leo, anthive, mys, imperfect-one, whd, tipu, beleg, mightypanda, holoz0r, fego, bilpcoinpower, daniostar, arsadulislam, victorrain, godflesh, taverngames, alinabarbu, knaveen, edryne678, bluerobo, hanke, prestoretro, elbrava, sn0n, borislavzlatanov, firealien, kdtkaren, malia.mancianti, robinmmthompson, firealiean, cardboard, profitcheck, me-we, honusurf, arcange, raphaelle, mauialohabella, mmoriarty, davedickeyyall, tomhall.leo, block.token, hayalet, haylike, coininstant, cwcost, klye, deathcross.leo, phgnomo, phbr, truthtrader, greer184, stuffbyspencer, vvk, megavest, pearltwin, bcm.leo, aceh.point, davidamsterdam, inertia, natha93, skepticology, netuoso, hive-122334, leomaniacsgr, kayceefresh, captainklaus, hamsterpoweriii, zagorisioss, urdreamscometrue, tangmo, sky-999,