Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/rawtransaction_util.h
// Copyright (c) 2017 The Bitcoin Core developers | // Copyright (c) 2017 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_RPC_RAWTRANSACTION_UTIL_H | #ifndef BITCOIN_RPC_RAWTRANSACTION_UTIL_H | ||||
#define BITCOIN_RPC_RAWTRANSACTION_UTIL_H | #define BITCOIN_RPC_RAWTRANSACTION_UTIL_H | ||||
#include <map> | #include <map> | ||||
#include <string> | |||||
class FillableSigningProvider; | class FillableSigningProvider; | ||||
class CChainParams; | class CChainParams; | ||||
class CMutableTransaction; | class CMutableTransaction; | ||||
class Coin; | class Coin; | ||||
class COutPoint; | class COutPoint; | ||||
class SigningProvider; | class SigningProvider; | ||||
class UniValue; | class UniValue; | ||||
/** | /** | ||||
* Sign a transaction with the given keystore and previous transactions | * Sign a transaction with the given keystore and previous transactions | ||||
* | * | ||||
* @param mtx The transaction to-be-signed | * @param mtx The transaction to-be-signed | ||||
* @param keystore Temporary keystore containing signing keys | * @param keystore Temporary keystore containing signing keys | ||||
* @param coins Map of unspent outputs | * @param coins Map of unspent outputs | ||||
* @param hashType The signature hash type | * @param hashType The signature hash type | ||||
* @param result JSON object where signed transaction results accumulate | * @param result JSON object where signed transaction results accumulate | ||||
*/ | */ | ||||
void SignTransaction(CMutableTransaction &mtx, const SigningProvider *keystore, | void SignTransaction(CMutableTransaction &mtx, const SigningProvider *keystore, | ||||
const std::map<COutPoint, Coin> &coins, | const std::map<COutPoint, Coin> &coins, | ||||
const UniValue &hashType, UniValue &result); | const UniValue &hashType, UniValue &result); | ||||
void SignTransactionResultToJSON(CMutableTransaction &mtx, bool complete, | |||||
const std::map<COutPoint, Coin> &coins, | |||||
std::map<int, std::string> &input_errors, | |||||
UniValue &result); | |||||
/** | /** | ||||
* Parse a prevtxs UniValue array and get the map of coins from it | * Parse a prevtxs UniValue array and get the map of coins from it | ||||
* | * | ||||
* @param prevTxs Array of previous txns outputs that tx depends on but | * @param prevTxs Array of previous txns outputs that tx depends on but | ||||
* may not yet be in the block chain | * may not yet be in the block chain | ||||
* @param keystore A pointer to the temprorary keystore if there is one | * @param keystore A pointer to the temprorary keystore if there is one | ||||
* @param coins Map of unspent outputs - coins in mempool and current | * @param coins Map of unspent outputs - coins in mempool and current | ||||
Show All 13 Lines |