Compare commits

..

4 Commits

Author SHA1 Message Date
Vinnie Falco
f0624581d1 Set version to 0.30.1-hf1 2016-02-11 18:19:31 -05:00
Vinnie Falco
cb23352a35 Revert "Set version to 0.30.1-hf1"
This reverts commit 9fea06ad84.
2016-02-11 18:19:08 -05:00
Vinnie Falco
9fea06ad84 Set version to 0.30.1-hf1 2016-02-11 15:48:32 -05:00
Miguel Portilla
2beeb9a293 Improved reporting for delivered_amount:
* Determine tx success from metadata result.
* Report delivered_amount for legacy account_tx queries.
2016-02-11 15:47:40 -05:00
4 changed files with 24 additions and 11 deletions

View File

@@ -35,7 +35,7 @@ char const* getRawVersionString ()
//
// The build version number (edit this for each release)
//
"0.30.1"
"0.30.1-hf1"
//
// Must follow the format described here:
//

View File

@@ -163,7 +163,7 @@ Json::Value doAccountTx (RPC::Context& context)
{
auto meta = it.second->getJson (1);
addPaymentDeliveredAmount (meta, context, it.first, it.second);
jvObj[jss::meta] = meta;
jvObj[jss::meta] = std::move(meta);
std::uint32_t uLedgerIndex = it.second->getLgrSeq ();

View File

@@ -29,6 +29,7 @@
#include <ripple/resource/Fees.h>
#include <ripple/rpc/Context.h>
#include <ripple/rpc/impl/LookupLedger.h>
#include <ripple/rpc/impl/Utilities.h>
#include <ripple/server/Role.h>
namespace ripple {
@@ -183,7 +184,10 @@ Json::Value doAccountTxOld (RPC::Context& context)
{
std::uint32_t uLedgerIndex = it->second->getLgrSeq ();
jvObj[jss::meta] = it->second->getJson (0);
auto meta = it->second->getJson(0);
addPaymentDeliveredAmount(meta, context, it->first, it->second);
jvObj[jss::meta] = std::move(meta);
jvObj[jss::validated]
= bValidated
&& uValidatedMin <= uLedgerIndex

View File

@@ -39,20 +39,29 @@ addPaymentDeliveredAmount (
{
// We only want to add a "delivered_amount" field if the transaction
// succeeded - otherwise nothing could have been delivered.
if (!transaction || transaction->getResult () != tesSUCCESS)
if (! transaction)
return;
auto serializedTx = transaction->getSTransaction ();
if (!serializedTx || serializedTx->getTxnType () != ttPAYMENT)
if (! serializedTx || serializedTx->getTxnType () != ttPAYMENT)
return;
// If the transaction explicitly specifies a DeliveredAmount in the
// metadata then we use it.
if (transactionMeta && transactionMeta->hasDeliveredAmount ())
if (transactionMeta)
{
if (transactionMeta->getResultTER() != tesSUCCESS)
return;
// If the transaction explicitly specifies a DeliveredAmount in the
// metadata then we use it.
if (transactionMeta->hasDeliveredAmount ())
{
meta[jss::delivered_amount] =
transactionMeta->getDeliveredAmount ().getJson (1);
return;
}
}
else if (transaction->getResult() != tesSUCCESS)
{
meta[jss::delivered_amount] =
transactionMeta->getDeliveredAmount ().getJson (1);
return;
}