Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

dash-tx.cpp File Reference
#include <base58.h>
#include <clientversion.h>
#include <coins.h>
#include <consensus/consensus.h>
#include <core_io.h>
#include <keystore.h>
#include <policy/policy.h>
#include <primitives/transaction.h>
#include <script/script.h>
#include <script/sign.h>
#include <univalue.h>
#include <util.h>
#include <utilmoneystr.h>
#include <utilstrencodings.h>
#include <memory>
#include <stdio.h>
#include <boost/algorithm/string.hpp>
#include <stacktraces.h>
+ Include dependency graph for dash-tx.cpp:

Go to the source code of this file.

Classes

class  Secp256k1Init
 

Functions

static int AppInitRawTx (int argc, char *argv[])
 
static void RegisterSetJson (const std::string &key, const std::string &rawJson)
 
static void RegisterSet (const std::string &strInput)
 
static void RegisterLoad (const std::string &strInput)
 
static CAmount ExtractAndValidateValue (const std::string &strValue)
 
static void MutateTxVersion (CMutableTransaction &tx, const std::string &cmdVal)
 
static void MutateTxLocktime (CMutableTransaction &tx, const std::string &cmdVal)
 
static void MutateTxAddInput (CMutableTransaction &tx, const std::string &strInput)
 
static void MutateTxAddOutAddr (CMutableTransaction &tx, const std::string &strInput)
 
static void MutateTxAddOutPubKey (CMutableTransaction &tx, const std::string &strInput)
 
static void MutateTxAddOutMultiSig (CMutableTransaction &tx, const std::string &strInput)
 
static void MutateTxAddOutData (CMutableTransaction &tx, const std::string &strInput)
 
static void MutateTxAddOutScript (CMutableTransaction &tx, const std::string &strInput)
 
static void MutateTxDelInput (CMutableTransaction &tx, const std::string &strInIdx)
 
static void MutateTxDelOutput (CMutableTransaction &tx, const std::string &strOutIdx)
 
static bool findSighashFlags (int &flags, const std::string &flagStr)
 
static CAmount AmountFromValue (const UniValue &value)
 
static void MutateTxSign (CMutableTransaction &tx, const std::string &flagStr)
 
static void MutateTx (CMutableTransaction &tx, const std::string &command, const std::string &commandVal)
 
static void OutputTxJSON (const CTransaction &tx)
 
static void OutputTxHash (const CTransaction &tx)
 
static void OutputTxHex (const CTransaction &tx)
 
static void OutputTx (const CTransaction &tx)
 
static std::string readStdin ()
 
static int CommandLineRawTx (int argc, char *argv[])
 
int main (int argc, char *argv[])
 

Variables

static bool fCreateBlank
 
static std::map< std::string, UniValueregisters
 
static const int CONTINUE_EXECUTION =-1
 
static const unsigned int N_SIGHASH_OPTS = 6
 
struct {
   const char *   flagStr
 
   int   flags
 
sighashOptions [N_SIGHASH_OPTS]
 

Function Documentation

◆ AmountFromValue()

◆ AppInitRawTx()

◆ CommandLineRawTx()

static int CommandLineRawTx ( int  argc,
char *  argv[] 
)
static

Definition at line 738 of file dash-tx.cpp.

References DecodeHexTx(), fCreateBlank, IsSwitchChar(), MutateTx(), OutputTx(), PrintExceptionContinue(), and readStdin().

Referenced by main().

◆ ExtractAndValidateValue()

static CAmount ExtractAndValidateValue ( const std::string &  strValue)
static

◆ findSighashFlags()

static bool findSighashFlags ( int &  flags,
const std::string &  flagStr 
)
static

Definition at line 472 of file dash-tx.cpp.

References flags, flagStr, N_SIGHASH_OPTS, and sighashOptions.

Referenced by MutateTxSign().

◆ main()

◆ MutateTx()

static void MutateTx ( CMutableTransaction tx,
const std::string &  command,
const std::string &  commandVal 
)
static

◆ MutateTxAddInput()

static void MutateTxAddInput ( CMutableTransaction tx,
const std::string &  strInput 
)
static

Definition at line 209 of file dash-tx.cpp.

References atoi(), IsHex(), MaxBlockSize(), uint256S(), and CMutableTransaction::vin.

Referenced by MutateTx().

◆ MutateTxAddOutAddr()

static void MutateTxAddOutAddr ( CMutableTransaction tx,
const std::string &  strInput 
)
static

◆ MutateTxAddOutData()

static void MutateTxAddOutData ( CMutableTransaction tx,
const std::string &  strInput 
)
static

Definition at line 366 of file dash-tx.cpp.

References ExtractAndValidateValue(), IsHex(), OP_RETURN, ParseHex(), and CMutableTransaction::vout.

Referenced by MutateTx().

◆ MutateTxAddOutMultiSig()

static void MutateTxAddOutMultiSig ( CMutableTransaction tx,
const std::string &  strInput 
)
static

◆ MutateTxAddOutPubKey()

static void MutateTxAddOutPubKey ( CMutableTransaction tx,
const std::string &  strInput 
)
static

◆ MutateTxAddOutScript()

static void MutateTxAddOutScript ( CMutableTransaction tx,
const std::string &  strInput 
)
static

◆ MutateTxDelInput()

static void MutateTxDelInput ( CMutableTransaction tx,
const std::string &  strInIdx 
)
static

Definition at line 433 of file dash-tx.cpp.

References atoi(), and CMutableTransaction::vin.

Referenced by MutateTx().

◆ MutateTxDelOutput()

static void MutateTxDelOutput ( CMutableTransaction tx,
const std::string &  strOutIdx 
)
static

Definition at line 446 of file dash-tx.cpp.

References atoi(), and CMutableTransaction::vout.

Referenced by MutateTx().

◆ MutateTxLocktime()

static void MutateTxLocktime ( CMutableTransaction tx,
const std::string &  cmdVal 
)
static

Definition at line 200 of file dash-tx.cpp.

References atoi64(), and CMutableTransaction::nLockTime.

Referenced by MutateTx().

◆ MutateTxSign()

◆ MutateTxVersion()

static void MutateTxVersion ( CMutableTransaction tx,
const std::string &  cmdVal 
)
static

Definition at line 191 of file dash-tx.cpp.

References atoi64(), CTransaction::MAX_STANDARD_VERSION, and CMutableTransaction::nVersion.

Referenced by MutateTx().

◆ OutputTx()

static void OutputTx ( const CTransaction tx)
static

Definition at line 708 of file dash-tx.cpp.

References gArgs, ArgsManager::GetBoolArg(), OutputTxHash(), OutputTxHex(), and OutputTxJSON().

Referenced by CommandLineRawTx().

◆ OutputTxHash()

static void OutputTxHash ( const CTransaction tx)
static

Definition at line 694 of file dash-tx.cpp.

References CTransaction::GetHash(), and base_blob< BITS >::GetHex().

Referenced by OutputTx().

◆ OutputTxHex()

static void OutputTxHex ( const CTransaction tx)
static

Definition at line 701 of file dash-tx.cpp.

References EncodeHexTx().

Referenced by OutputTx().

◆ OutputTxJSON()

static void OutputTxJSON ( const CTransaction tx)
static

Definition at line 685 of file dash-tx.cpp.

References TxToUniv(), UniValue::VOBJ, and UniValue::write().

Referenced by OutputTx().

◆ readStdin()

static std::string readStdin ( )
static

Definition at line 718 of file dash-tx.cpp.

Referenced by CommandLineRawTx().

◆ RegisterLoad()

static void RegisterLoad ( const std::string &  strInput)
static

Definition at line 142 of file dash-tx.cpp.

References error(), fsbridge::fopen(), and RegisterSetJson().

Referenced by MutateTx().

◆ RegisterSet()

static void RegisterSet ( const std::string &  strInput)
static

Definition at line 127 of file dash-tx.cpp.

References RegisterSetJson().

Referenced by MutateTx().

◆ RegisterSetJson()

static void RegisterSetJson ( const std::string &  key,
const std::string &  rawJson 
)
static

Definition at line 116 of file dash-tx.cpp.

References UniValue::read(), and registers.

Referenced by RegisterLoad(), and RegisterSet().

Variable Documentation

◆ CONTINUE_EXECUTION

const int CONTINUE_EXECUTION =-1
static

Definition at line 33 of file dash-tx.cpp.

Referenced by AppInitRawTx(), and main().

◆ fCreateBlank

bool fCreateBlank
static

Definition at line 31 of file dash-tx.cpp.

Referenced by AppInitRawTx(), and CommandLineRawTx().

◆ flags

◆ flagStr

const char* flagStr

Definition at line 461 of file dash-tx.cpp.

Referenced by findSighashFlags(), and MutateTxSign().

◆ N_SIGHASH_OPTS

const unsigned int N_SIGHASH_OPTS = 6
static

Definition at line 459 of file dash-tx.cpp.

Referenced by findSighashFlags().

◆ registers

std::map<std::string,UniValue> registers
static

Definition at line 32 of file dash-tx.cpp.

Referenced by MutateTxSign(), and RegisterSetJson().

◆ sighashOptions

const { ... } sighashOptions[N_SIGHASH_OPTS]
Initial value:
= {
{"ALL", SIGHASH_ALL},
{"NONE", SIGHASH_NONE},
{"SINGLE", SIGHASH_SINGLE},
{"ALL|ANYONECANPAY", SIGHASH_ALL|SIGHASH_ANYONECANPAY},
{"NONE|ANYONECANPAY", SIGHASH_NONE|SIGHASH_ANYONECANPAY},
{"SINGLE|ANYONECANPAY", SIGHASH_SINGLE|SIGHASH_ANYONECANPAY},
}

Referenced by findSighashFlags().

Released under the MIT license