BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
Go to the documentation of this file.
25 #include <graphene/chain/hardfork.hpp>
28 namespace graphene {
namespace chain {
namespace detail {
37 : _impacted( impact ), _ignore_custom_op_reqd_auths( ignore_custom_op_required_auths )
44 _impacted.insert( op.
to );
170 vector<authority> other;
173 _ignore_custom_op_reqd_auths );
174 for(
const auto& o : other )
220 _impacted.insert( op.
owner );
233 if( !_ignore_custom_op_reqd_auths )
246 _impacted.insert( op.
to );
247 _impacted.insert( op.
from );
253 for(
const auto& out : op.
outputs )
259 for(
const auto& in : op.
inputs )
261 for(
const auto& out : op.
outputs )
267 _impacted.insert( op.
to );
268 for(
const auto& in : op.
inputs )
282 _impacted.insert( op.
to );
290 _impacted.insert( op.
from );
292 _impacted.insert( op.
to );
404 bool ignore_custom_op_required_auths )
412 bool ignore_custom_op_required_auths )
418 static void get_relevant_accounts(
const object* obj, flat_set<account_id_type>& accounts,
419 bool ignore_custom_op_required_auths ) {
420 FC_ASSERT( obj !=
nullptr,
"Internal error: get_relevant_accounts called with nullptr" );
423 switch( (object_type)obj->id.type() )
425 case null_object_type:
426 case base_object_type:
428 case account_object_type:
429 accounts.insert( account_id_type(obj->id) );
431 case asset_object_type:{
432 const auto* aobj =
dynamic_cast<const asset_object*
>(obj);
433 accounts.insert( aobj->issuer );
435 }
case force_settlement_object_type:{
436 const auto* aobj =
dynamic_cast<const force_settlement_object*
>(obj);
437 accounts.insert( aobj->owner );
439 }
case committee_member_object_type:{
440 const auto* aobj =
dynamic_cast<const committee_member_object*
>(obj);
441 accounts.insert( aobj->committee_member_account );
443 }
case witness_object_type:{
444 const auto* aobj =
dynamic_cast<const witness_object*
>(obj);
445 accounts.insert( aobj->witness_account );
447 }
case limit_order_object_type:{
448 const auto* aobj =
dynamic_cast<const limit_order_object*
>(obj);
449 accounts.insert( aobj->seller );
451 }
case call_order_object_type:{
452 const auto* aobj =
dynamic_cast<const call_order_object*
>(obj);
453 accounts.insert( aobj->borrower );
455 }
case custom_object_type:
457 case proposal_object_type:{
458 const auto* aobj =
dynamic_cast<const proposal_object*
>(obj);
460 ignore_custom_op_required_auths );
462 }
case operation_history_object_type:{
463 const auto* aobj =
dynamic_cast<const operation_history_object*
>(obj);
465 ignore_custom_op_required_auths );
467 }
case withdraw_permission_object_type:{
468 const auto* aobj =
dynamic_cast<const withdraw_permission_object*
>(obj);
469 accounts.insert( aobj->withdraw_from_account );
470 accounts.insert( aobj->authorized_account );
472 }
case vesting_balance_object_type:{
473 const auto* aobj =
dynamic_cast<const vesting_balance_object*
>(obj);
474 accounts.insert( aobj->owner );
476 }
case worker_object_type:{
477 const auto* aobj =
dynamic_cast<const worker_object*
>(obj);
478 accounts.insert( aobj->worker_account );
480 }
case balance_object_type:
483 case htlc_object_type:{
484 const auto* htlc_obj =
dynamic_cast<const htlc_object*
>(obj);
485 accounts.insert( htlc_obj->transfer.from );
486 accounts.insert( htlc_obj->transfer.to );
488 }
case custom_authority_object_type:{
489 const auto* cust_auth_obj =
dynamic_cast<const custom_authority_object*
>( obj );
490 accounts.insert( cust_auth_obj->account );
493 }
case ticket_object_type:{
494 const auto* aobj =
dynamic_cast<const ticket_object*
>( obj );
495 accounts.insert( aobj->account );
497 }
case liquidity_pool_object_type:
500 case samet_fund_object_type:{
501 const auto* aobj =
dynamic_cast<const samet_fund_object*
>( obj );
502 accounts.insert( aobj->owner_account );
504 }
case credit_offer_object_type:{
505 const auto* aobj =
dynamic_cast<const credit_offer_object*
>( obj );
506 accounts.insert( aobj->owner_account );
508 }
case credit_deal_object_type:{
509 const auto* aobj =
dynamic_cast<const credit_deal_object*
>( obj );
510 accounts.insert( aobj->offer_owner );
511 accounts.insert( aobj->borrower );
519 switch( (impl_object_type)obj->id.type() )
521 case impl_global_property_object_type:
523 case impl_dynamic_global_property_object_type:
525 case impl_reserved0_object_type:
527 case impl_asset_dynamic_data_object_type:
529 case impl_asset_bitasset_data_object_type:
531 case impl_account_balance_object_type:{
532 const auto* aobj =
dynamic_cast<const account_balance_object*
>(obj);
533 accounts.insert( aobj->owner );
535 }
case impl_account_statistics_object_type:{
536 const auto* aobj =
dynamic_cast<const account_statistics_object*
>(obj);
537 accounts.insert( aobj->owner );
539 }
case impl_transaction_history_object_type:{
540 const auto* aobj =
dynamic_cast<const transaction_history_object*
>(obj);
542 ignore_custom_op_required_auths );
544 }
case impl_blinded_balance_object_type:{
545 const auto* aobj =
dynamic_cast<const blinded_balance_object*
>(obj);
546 for(
const auto& a : aobj->owner.account_auths )
547 accounts.insert( a.first );
549 }
case impl_block_summary_object_type:
551 case impl_account_history_object_type: {
552 const auto* aobj =
dynamic_cast<const account_history_object*
>(obj);
553 accounts.insert( aobj->account );
555 }
case impl_chain_property_object_type:
557 case impl_witness_schedule_object_type:
559 case impl_budget_record_object_type:
561 case impl_special_authority_object_type:
563 case impl_buyback_object_type:
565 case impl_fba_accumulator_object_type:
567 case impl_collateral_bid_object_type:{
568 const auto* aobj =
dynamic_cast<const collateral_bid_object*
>(obj);
569 accounts.insert( aobj->bidder );
571 }
case impl_credit_deal_summary_object_type:{
572 const auto* aobj =
dynamic_cast<const credit_deal_summary_object*
>(obj);
573 accounts.insert( aobj->offer_owner );
574 accounts.insert( aobj->borrower );
592 void database::notify_changed_objects()
594 if( _undo_db.enabled() )
596 const auto& head_undo = _undo_db.head();
597 auto chain_time = head_block_time();
600 if( !new_objects.empty() )
602 vector<object_id_type> new_ids;
603 new_ids.reserve(head_undo.new_ids.size());
604 flat_set<account_id_type> new_accounts_impacted;
605 for(
const auto& item : head_undo.new_ids )
607 new_ids.push_back(item);
608 auto* obj = find_object(item);
610 get_relevant_accounts(obj, new_accounts_impacted,
611 MUST_IGNORE_CUSTOM_OP_REQD_AUTHS(chain_time));
614 if( !new_ids.empty() )
619 if( !changed_objects.empty() )
621 vector<object_id_type> changed_ids;
622 changed_ids.reserve(head_undo.old_values.size());
623 flat_set<account_id_type> changed_accounts_impacted;
624 for(
const auto& item : head_undo.old_values )
626 changed_ids.push_back(item.first);
627 get_relevant_accounts(item.second.get(), changed_accounts_impacted,
628 MUST_IGNORE_CUSTOM_OP_REQD_AUTHS(chain_time));
631 if( !changed_ids.empty() )
636 if( !removed_objects.empty() )
638 vector<object_id_type> removed_ids;
639 removed_ids.reserve( head_undo.removed.size() );
640 vector<const object*> removed;
641 removed.reserve( head_undo.removed.size() );
642 flat_set<account_id_type> removed_accounts_impacted;
643 for(
const auto& item : head_undo.removed )
645 removed_ids.emplace_back( item.first );
646 auto* obj = item.second.get();
647 removed.emplace_back( obj );
648 get_relevant_accounts(obj, removed_accounts_impacted,
649 MUST_IGNORE_CUSTOM_OP_REQD_AUTHS(chain_time));
652 if( !removed_ids.empty() )
656 }
catch(
const graphene::chain::plugin_exception& e ) {
657 elog(
"Caught plugin exception: ${e}", (
"e", e.to_detail_string() ) );
account_id_type fee_payer() const
account_id_type fee_payer() const
account_id_type fee_payer() const
account_id_type fee_payer() const
vector< operation > operations
account_id_type fee_payer() const
The proposal_update_operation updates an existing transaction proposal.
void operator()(const witness_create_operation &op)
Converts public account balance to a blinded or stealth balance.
account_id_type fee_payer() const
Update an existing withdraw permission.
account_id_type fee_payer() const
void operator()(const custom_authority_create_operation &op)
account_id_type fee_payer() const
who will pay the fee
provides a generic way to add higher level protocols on top of witness consensus
Withdraw from a vesting balance.
account_id_type withdraw_from_account
Must match withdraw_permission->withdraw_from_account.
Delete a SameT Fund object.
void operator()(const withdraw_permission_update_operation &op)
Transfers from blind to blind.
account_id_type fee_payer() const
account_id_type fee_payer() const
void add_authority_accounts(flat_set< account_id_type > &result, const authority &a)
account_id_type fee_payer() const
void operator()(const limit_order_cancel_operation &op)
void operator()(const ticket_create_operation &op)
vector< blind_input > inputs
Create a vesting balance.
void operator()(const transfer_operation &op)
optional< authority > active
New active authority. This can be updated by the current active authority.
Create a new credit offer.
account_id_type fee_payer() const
account_id_type fee_payer() const
Create a new custom authority.
Exchange with a liquidity pool.
account_id_type fee_payer() const
used to transfer accumulated fees back to the issuer's balance.
void operator()(const asset_publish_feed_operation &op)
void operator()(const liquidity_pool_deposit_operation &op)
void operator()(const committee_member_create_operation &op)
account_id_type fee_payer() const
void operator()(const htlc_create_operation &op)
void operator()(const proposal_delete_operation &op)
account_id_type fee_payer() const
void operator()(const vesting_balance_withdraw_operation &op)
void operator()(const withdraw_permission_claim_operation &op)
Create a committee_member object, as a bid to hold a committee_member seat on the network.
void operator()(const asset_settle_operation &op)
vector< blind_output > outputs
Update issuer of an asset.
void operator()(const custom_authority_delete_operation &op)
account_id_type owner
Who is able to withdraw the balance.
groups operations that should be applied atomically
void operator()(const vesting_balance_create_operation &op)
account_id_type fee_payer() const
account_id_type fee_payer() const
Create a new liquidity pool.
Update a committee_member object.
account_id_type fee_payer() const
account_id_type fee_payer() const
void operator()(const asset_update_issuer_operation &op)
void operator()(const account_update_operation &op)
account_id_type fee_payer() const
transfers the account to another account while clearing the white list
account_id_type fee_payer() const
account_id_type fee_payer() const
account_id_type fee_payer() const
void operator()(const committee_member_update_global_parameters_operation &op)
void operator()(const asset_global_settle_operation &op)
flat_set< account_id_type > & _impacted
authority auth
Authentication requirements for the custom authority.
void operator()(const asset_create_operation &op)
void operator()(const call_order_update_operation &op)
void operator()(const limit_order_create_operation &op)
Create a witness object, as a bid to hold a witness position on the network.
void operator()(const samet_fund_update_operation &op)
account_id_type authorized_account
The account previously authorized to make withdrawals. Must match withdrawal_permission->authorized_a...
Borrow from a SameT Fund.
Update an existing account.
account_id_type fee_payer() const
Create a new worker object.
Create a new SameT Fund object.
account_id_type referrer
This account receives a portion of the fee split between registrar and referrer. Must be a member.
void operator()(const asset_update_bitasset_operation &op)
Update a SameT Fund object.
optional< authority > owner
New owner authority. If set, this operation requires owner authority to execute.
account_id_type fee_payer() const
Withdraw from a liquidity pool.
account_id_type fee_payer() const
Delete a custom authority.
Update a witness object's URL and block signing key.
void operator()(const ticket_update_operation &op)
adds a signature to a transaction
account_id_type fee_payer() const
Withdraw from an account which has published a withdrawal permission.
void operator()(const liquidity_pool_update_operation &op)
assert that some conditions are true.
void operator()(const htlc_refund_operation &op)
account_id_type fee_payer() const
account_id_type fee_payer() const
account_id_type account_to_list
The account being opined about.
account_id_type authorized_account
The account authorized to make withdrawals. Must match permission_to_update->authorized_account.
void operator()(const custom_authority_update_operation &op)
void operator()(const withdraw_permission_create_operation &op)
Converts blinded/stealth balance to a public account balance.
void operator()(const credit_offer_accept_operation &op)
void operator()(const credit_deal_repay_operation &op)
account_id_type fee_payer() const
account_id_type fee_payer() const
used to take an asset out of circulation, returning to the issuer
Update options common to all assets.
#define FC_CAPTURE_AND_LOG(...)
Create a new withdrawal permission.
account_id_type fee_payer() const
Updates an existing ticket.
account_id_type fee_payer() const
void operator()(const fba_distribute_operation &op)
account_id_type fee_payer() const
account_id_type authorized_account
The account authorized to make withdrawals from withdraw_from_account.
account_id_type fee_payer() const
void operator()(const fill_order_operation &op)
account_id_type from
Account to transfer asset from.
account_id_type fee_payer() const
account_id_type fee_payer() const
Accept a credit offer, thereby creating a credit deal.
account_id_type fee_payer() const
account_id_type fee_payer() const
Transfers an amount of one asset from one account to another.
optional< authority > new_auth
Change to the authentication for the custom authority.
account_id_type fee_payer() const
void operator()(const asset_issue_operation &op)
void operator()(const assert_operation &op)
account_id_type fee_payer() const
Deposit to a liquidity pool.
account_id_type fee_payer() const
flat_set< account_id_type > required_auths
account_id_type fee_payer() const
account_id_type to
Account to transfer asset to.
account_id_type fee_payer() const
void operator()(const samet_fund_delete_operation &op)
get_impacted_account_visitor(flat_set< account_id_type > &impact, bool ignore_custom_op_required_auths)
Delete an existing withdrawal permission.
Update a custom authority.
void operator()(const proposal_create_operation &op)
Claim a balance in a graphene::chain::balance_object.
Update options specific to BitAssets.
void operator()(const custom_operation &op)
vector< blind_input > inputs
account_id_type fee_payer() const
void operator()(const samet_fund_repay_operation &op)
account_id_type fee_payer() const
Who is to pay the fee.
account_id_type to
Account to transfer asset to.
void operator()(const account_create_operation &op)
Publish price feeds for market-issued assets.
account_id_type fee_payer() const
account_id_type fee_payer() const
account_id_type fee_payer() const
void operator()(const committee_member_update_operation &op)
account_id_type fee_payer() const
void operator()(const asset_claim_pool_operation &op)
void operator()(const asset_reserve_operation &op)
void operator()(const htlc_extend_operation &op)
account_id_type fee_payer() const
account_id_type fee_payer() const
void operator()(const withdraw_permission_delete_operation &op)
bool _ignore_custom_op_reqd_auths
account_id_type fee_payer() const
account_id_type fee_payer() const
void operator()(const asset_update_feed_producers_operation &op)
The proposal_delete_operation deletes an existing transaction proposal.
account_id_type issue_to_account
void operation_get_required_authorities(const operation &op, flat_set< account_id_type > &active, flat_set< account_id_type > &owner, vector< authority > &other, bool ignore_custom_operation_required_auths)
Used by committee_members to update the global parameters of the blockchain.
void operator()(const execute_bid_operation &op)
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
void operator()(const proposal_update_operation &op)
void operator()(const liquidity_pool_delete_operation &op)
#define GRAPHENE_TRY_NOTIFY(signal,...)
Update the set of feed-producing accounts for a BitAsset.
void operator()(const credit_deal_update_operation &op)
void operator()(const liquidity_pool_withdraw_operation &op)
void operator()(const credit_offer_delete_operation &op)
Schedules a market-issued asset for automatic settlement.
account_id_type fee_payer() const
void operator()(const transfer_from_blind_operation &op)
A credit deal expired without being fully repaid.
account_id_type fee_payer() const
void operator()(const samet_fund_borrow_operation &op)
void operation_get_impacted_accounts(const operation &op, flat_set< account_id_type > &result, bool ignore_custom_op_required_auths)
Manage an account's membership status.
account_id_type fee_payer() const
account_id_type borrower
The account who repays to the credit offer.
void operator()(const account_upgrade_operation &op)
void operator()(const worker_create_operation &op)
void operator()(const asset_fund_fee_pool_operation &op)
void operator()(const witness_update_operation &op)
instructs the blockchain to attempt to sell one asset for another
void operator()(const credit_deal_expired_operation &op)
account_id_type fee_payer() const
void operator()(const override_transfer_operation &op)
Allows the issuer of an asset to transfer an asset from any account to any account if they have overr...
account_id_type fee_payer() const
void operator()(const htlc_redeem_operation &op)
visitor::result_type visit(visitor &v)
void operator()(const liquidity_pool_create_operation &op)
void operator()(const liquidity_pool_exchange_operation &op)
account_id_type fee_payer() const
void operator()(const samet_fund_create_operation &op)
This operation is used to whitelist and blacklist accounts, primarily for transacting in whitelisted ...
account_id_type fee_payer() const
Who is to pay the fee.
void operator()(const transfer_to_blind_operation &op)
account_id_type fee_payer() const
vector< op_wrapper > proposed_ops
account_id_type fee_payer() const
account_id_type fee_payer() const
optional< account_id_type > new_issuer
If the asset is to be given a new issuer, specify his ID here.
The proposal_create_operation creates a transaction proposal, for use in multi-sig scenarios.
account_id_type fee_payer() const
void operator()(const bid_collateral_operation &op)
void transaction_get_impacted_accs(const transaction &tx, flat_set< account_id_type > &result, bool ignore_custom_op_required_auths)
account_id_type fee_payer() const
vector< blind_output > outputs
account_id_type fee_payer() const
void operator()(const credit_offer_update_operation &op)
account_id_type offer_owner
Owner of the credit offer.
account_id_type new_issuer
void operator()(const asset_settle_cancel_operation &op)
account_id_type fee_payer() const
account_id_type fee_payer() const
void operator()(const balance_claim_operation &op)
void operator()(const blind_transfer_operation &op)
void operator()(const asset_update_operation &op)
void operator()(const credit_offer_create_operation &op)
void operator()(const account_whitelist_operation &op)
allows global settling of bitassets (black swan or prediction markets)
account_id_type fee_payer() const
void operator()(const asset_claim_fees_operation &op)
void operator()(const htlc_redeemed_operation &op)
Transfers BTS from the fee pool of a specified asset back to the issuer's balance.
account_id_type fee_payer() const
void operator()(const limit_order_update_operation &op)
account_id_type fee_payer() const
void operator()(const account_transfer_operation &op)
account_id_type fee_payer() const
account_id_type fee_payer() const
account_id_type fee_payer() const