![]() |
Dash Core
0.12.2.1
P2P Digital Currency
|
#include "policy/policy.h"
#include "validation.h"
#include "tinyformat.h"
#include "util.h"
#include "utilstrencodings.h"
#include <boost/foreach.hpp>
Go to the source code of this file.
Functions | |
bool | IsStandard (const CScript &scriptPubKey, txnouttype &whichType) |
bool | IsStandardTx (const CTransaction &tx, std::string &reason) |
bool | AreInputsStandard (const CTransaction &tx, const CCoinsViewCache &mapInputs) |
bool AreInputsStandard | ( | const CTransaction & | tx, |
const CCoinsViewCache & | mapInputs | ||
) |
Check for standard transaction types
[in] | mapInputs | Map of previous transactions that have outputs we're spending |
Definition at line 123 of file policy.cpp.
Referenced by AcceptToMemoryPoolWorker().
bool IsStandard | ( | const CScript & | scriptPubKey, |
txnouttype & | whichType | ||
) |
Check transaction inputs to mitigate two potential denial-of-service attacks:
Check transaction inputs, and make sure any pay-to-script-hash transactions are evaluating IsStandard scripts
Why bother? To avoid denial-of-service attacks; an attacker can submit a standard HASH... OP_EQUAL transaction, which will get accepted into blocks. The redemption script can be anything; an attacker could use a very expensive-to-check-upon-redemption script like: DUP CHECKSIG DROP ... repeated 100 times... OP_1
Definition at line 37 of file policy.cpp.
Referenced by IsStandardTx().
bool IsStandardTx | ( | const CTransaction & | tx, |
std::string & | reason | ||
) |
Check for standard transaction types
Definition at line 59 of file policy.cpp.
Referenced by AcceptToMemoryPoolWorker().