xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
libxrpl
ledger
helpers
libxrpl/ledger/helpers/ProposalHelpers.cpp
1
#include <xrpl/ledger/helpers/ProposalHelpers.h>
2
3
#include <xrpl/protocol/SField.h>
4
#include <xrpl/protocol/STArray.h>
5
#include <xrpl/protocol/STObject.h>
6
#include <xrpl/protocol/STTx.h>
7
#include <xrpl/protocol/TxFlags.h>
8
#include <xrpl/protocol/TxFormats.h>
9
10
namespace
xrpl::proposal
{
11
12
bool
13
isValidProposal
(
STObject
const
& proposedTx)
14
{
15
if
(
isProposalTx
(proposedTx))
16
return
false
;
17
18
if
(
isPseudoTx
(proposedTx))
19
return
false
;
20
21
if
(proposedTx.
isFieldPresent
(sfFlags) &&
22
(proposedTx.
getFieldU32
(sfFlags) &
tfInnerBatchTxn
) != 0u)
23
return
false
;
24
25
if
(proposedTx.
getFieldU16
(sfTransactionType) == ttBATCH &&
26
proposedTx.
isFieldPresent
(sfRawTransactions))
27
{
28
STArray
const
& innerTxns = proposedTx.
getFieldArray
(sfRawTransactions);
29
for
(
STObject
const
& inner : innerTxns)
30
{
31
if
(
isProposalTx
(inner) ||
isPseudoTx
(inner))
32
return
false
;
33
}
34
}
35
36
return
true
;
37
}
38
39
}
// namespace xrpl::proposal
xrpl::STArray
Definition
STArray.h:20
xrpl::STObject
Definition
STObject.h:49
xrpl::STObject::getFieldU32
std::uint32_t getFieldU32(SField const &field) const
Definition
STObject.cpp:601
xrpl::STObject::getFieldArray
STArray const & getFieldArray(SField const &field) const
Definition
STObject.cpp:688
xrpl::STObject::isFieldPresent
bool isFieldPresent(SField const &field) const
Definition
STObject.cpp:464
xrpl::STObject::getFieldU16
std::uint16_t getFieldU16(SField const &field) const
Definition
STObject.cpp:595
xrpl::proposal
Definition
ProposalHelpers.h:9
xrpl::proposal::isValidProposal
bool isValidProposal(STObject const &proposedTx)
Whether the proposed transaction is independently submittable through the ordinary multi-sign path: n...
Definition
libxrpl/ledger/helpers/ProposalHelpers.cpp:13
xrpl::proposal::isProposalTx
bool isProposalTx(STObject const &proposedTx)
Whether the proposed transaction is itself a proposal transaction, which would nest one proposal insi...
Definition
ProposalHelpers.h:41
xrpl::tfInnerBatchTxn
constexpr FlagValue tfInnerBatchTxn
Definition
TxFlags.h:44
xrpl::isPseudoTx
bool isPseudoTx(STObject const &tx)
Check whether a transaction is a pseudo-transaction.
Definition
STTx.cpp:889
Generated by
1.17.0