Only report 'delivered_amount' for executed payments (RIPD-827)

This commit is contained in:
Nik Bougalis
2015-03-09 22:26:51 -07:00
committed by Tom Ritchford
parent 6c81ea846c
commit 040982e321

View File

@@ -32,7 +32,9 @@ addPaymentDeliveredAmount (
{
STTx::pointer serializedTx;
if (transaction)
// We only want to add a "delivered_amount" field if the transaction
// succeeded - otherwise nothing could have been delivered.
if (transaction && transaction->getResult () == tesSUCCESS)
serializedTx = transaction->getSTransaction ();
if (serializedTx && serializedTx->getTxnType () == ttPAYMENT)