File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -151,13 +151,15 @@ void CompositeTrade::fromXML(XMLNode* node) {
151151 trade = TradeFactory::instance ().build (tradeType);
152152 trade->id () = id;
153153 trade->fromXML (nodes[i]);
154- // if a sub trade does not have an envelope, we provide the main trade's one
155- if (!trade->envelope ().initialized ())
156- trade->envelope () = this ->envelope ();
154+ // the component trade's envelope is the main trade's envelope with possibly overwritten add fields
155+ Envelope env = this ->envelope ();
156+ for (auto const & [k, v] : trade->envelope ().fullAdditionalFields ())
157+ env.setAdditionalField (k,v);
158+ trade->setEnvelope (env);
157159 trades_.push_back (trade);
160+ auto tmpenv = trade->envelope ();
158161 DLOG (" Added Trade " << id << " (" << trade->id () << " )"
159162 << " type:" << tradeType << " to composite trade " << this ->id () << " ." );
160- std::cout << " adding trade:\n " << trade->toXMLString () << std::endl;
161163 } catch (const std::exception& e) {
162164 StructuredTradeErrorMessage (
163165 id, this ->tradeType (),
You can’t perform that action at this time.
0 commit comments