From 29c636fcef74aeb8a56a0067b04b22e469eece4f Mon Sep 17 00:00:00 2001 From: elmato Date: Fri, 10 Feb 2017 08:33:44 +0000 Subject: [PATCH] add get_market() function to call_order_object --- libraries/chain/include/graphene/chain/market_object.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libraries/chain/include/graphene/chain/market_object.hpp b/libraries/chain/include/graphene/chain/market_object.hpp index c41def13..b56f4e9c 100644 --- a/libraries/chain/include/graphene/chain/market_object.hpp +++ b/libraries/chain/include/graphene/chain/market_object.hpp @@ -120,6 +120,13 @@ class call_order_object : public abstract_object share_type collateral; ///< call_price.base.asset_id, access via get_collateral share_type debt; ///< call_price.quote.asset_id, access via get_collateral price call_price; ///< Debt / Collateral + + pair get_market()const + { + auto tmp = std::make_pair( call_price.base.asset_id, call_price.quote.asset_id ); + if( tmp.first > tmp.second ) std::swap( tmp.first, tmp.second ); + return tmp; + } }; /**