xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
xrpld
app
misc
detail
DeliverMax.cpp
1
#include <xrpld/app/misc/DeliverMax.h>
2
3
#include <xrpl/protocol/TxFormats.h>
4
#include <xrpl/protocol/jss.h>
5
6
namespace
xrpl::rpc
{
7
8
void
9
insertDeliverMax
(
json::Value
& txJson,
TxType
txnType,
unsigned
int
apiVersion)
10
{
11
if
(txJson.
isMember
(jss::Amount))
12
{
13
if
(txnType == ttPAYMENT)
14
{
15
txJson[jss::DeliverMax] = txJson[jss::Amount];
16
if
(apiVersion > 1)
17
txJson.
removeMember
(jss::Amount);
18
}
19
}
20
}
21
22
}
// namespace xrpl::rpc
json::Value
Represents a JSON value.
Definition
json_value.h:117
json::Value::removeMember
Value removeMember(char const *key)
Remove and return the named member.
Definition
json_value.cpp:1022
json::Value::isMember
bool isMember(char const *key) const
Return true if the object has a member named key.
Definition
json_value.cpp:1049
xrpl::rpc
API version numbers used in later API versions.
Definition
ApiVersion.h:36
xrpl::rpc::insertDeliverMax
void insertDeliverMax(json::Value &txJson, TxType txnType, unsigned int apiVersion)
Copy Amount field to DeliverMax field in transaction output JSON.
Definition
DeliverMax.cpp:9
xrpl::TxType
TxType
Transaction type identifiers.
Definition
TxFormats.h:45
Generated by
1.17.0