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> | ||||
class CBasicKeyStore; | class FillableSigningProvider; | ||||
class CChainParams; | class CChainParams; | ||||
class CMutableTransaction; | class CMutableTransaction; | ||||
class Coin; | class Coin; | ||||
class COutPoint; | class COutPoint; | ||||
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 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 Temporary keystore containing signing keys | * @param keystore Temporary keystore containing signing keys | ||||
* @param coins Map of unspent outputs - coins in mempool and current | * @param coins Map of unspent outputs - coins in mempool and current | ||||
* chain UTXO set, may be extended by previous txns outputs after call | * chain UTXO set, may be extended by previous txns outputs after call | ||||
* @param tempKeystore Whether to use temporary keystore | * @param tempKeystore Whether to use temporary keystore | ||||
* @param hashType The signature hash type | * @param hashType The signature hash type | ||||
* @returns JSON object with details of signed transaction | * @returns JSON object with details of signed transaction | ||||
*/ | */ | ||||
UniValue SignTransaction(CMutableTransaction &mtx, const UniValue &prevTxs, | UniValue SignTransaction(CMutableTransaction &mtx, const UniValue &prevTxs, | ||||
CBasicKeyStore *keystore, | FillableSigningProvider *keystore, | ||||
std::map<COutPoint, Coin> &coins, bool tempKeystore, | std::map<COutPoint, Coin> &coins, bool tempKeystore, | ||||
const UniValue &hashType); | const UniValue &hashType); | ||||
/** Create a transaction from univalue parameters */ | /** Create a transaction from univalue parameters */ | ||||
CMutableTransaction ConstructTransaction(const CChainParams ¶ms, | CMutableTransaction ConstructTransaction(const CChainParams ¶ms, | ||||
const UniValue &inputs_in, | const UniValue &inputs_in, | ||||
const UniValue &outputs_in, | const UniValue &outputs_in, | ||||
const UniValue &locktime); | const UniValue &locktime); | ||||
#endif // BITCOIN_RPC_RAWTRANSACTION_UTIL_H | #endif // BITCOIN_RPC_RAWTRANSACTION_UTIL_H |