diff --git a/src/ripple/module/app/ledger/AcceptedLedgerTx.cpp b/src/ripple/module/app/ledger/AcceptedLedgerTx.cpp index f0fc80ef9..d28301d29 100644 --- a/src/ripple/module/app/ledger/AcceptedLedgerTx.cpp +++ b/src/ripple/module/app/ledger/AcceptedLedgerTx.cpp @@ -94,7 +94,7 @@ void AcceptedLedgerTx::buildJson () LedgerEntrySet les (mLedger, tapNONE, true); auto const ownerFunds (les.accountFunds (account, amount, fhIGNORE_FREEZE)); - mJson[jss::owner_funds] = ownerFunds.getText (); + mJson[jss::transaction][jss::owner_funds] = ownerFunds.getText (); } } } diff --git a/src/ripple/module/app/misc/NetworkOPs.cpp b/src/ripple/module/app/misc/NetworkOPs.cpp index f5b026b39..9f5b5eee2 100644 --- a/src/ripple/module/app/misc/NetworkOPs.cpp +++ b/src/ripple/module/app/misc/NetworkOPs.cpp @@ -2619,12 +2619,12 @@ void NetworkOPsImp::reportFeeChange () std::bind (&NetworkOPsImp::pubServer, this)); } -Json::Value NetworkOPsImp::transJson ( +// This routine should only be used to publish accepted or validated +// transactions. +Json::Value NetworkOPsImp::transJson( const SerializedTransaction& stTxn, TER terResult, bool bValidated, Ledger::ref lpCurrent) { - // This routine should only be used to publish accepted or validated - // transactions. Json::Value jvObj (Json::objectValue); std::string sToken; std::string sHuman; @@ -2655,6 +2655,21 @@ Json::Value NetworkOPsImp::transJson ( jvObj[jss::engine_result_code] = terResult; jvObj[jss::engine_result_message] = sHuman; + if (stTxn.getTxnType() == ttOFFER_CREATE) + { + auto const account (stTxn.getSourceAccount ().getAccountID ()); + auto const amount (stTxn.getFieldAmount (sfTakerGets)); + + // If the offer create is not self funded then add the owner balance + if (account != amount.issue ().account) + { + LedgerEntrySet les (lpCurrent, tapNONE, true); + auto const ownerFunds (les.accountFunds (account, amount, fhIGNORE_FREEZE)); + + jvObj[jss::transaction][jss::owner_funds] = ownerFunds.getText (); + } + } + return jvObj; }