2018-07-26 18:36:45 -04:00
|
|
|
// Copyright (c) 2017-2018 The Bitcoin Core developers
|
2017-06-12 12:23:02 -07:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
2019-04-02 16:51:32 -04:00
|
|
|
#ifndef BITCOIN_RPC_RAWTRANSACTION_UTIL_H
|
|
|
|
#define BITCOIN_RPC_RAWTRANSACTION_UTIL_H
|
2017-06-12 12:23:02 -07:00
|
|
|
|
2019-04-10 13:38:41 +00:00
|
|
|
#include <map>
|
|
|
|
|
2017-06-12 12:23:02 -07:00
|
|
|
class CBasicKeyStore;
|
|
|
|
class UniValue;
|
2019-04-02 16:51:32 -04:00
|
|
|
struct CMutableTransaction;
|
2019-04-10 13:38:41 +00:00
|
|
|
class Coin;
|
|
|
|
class COutPoint;
|
2017-06-12 12:23:02 -07:00
|
|
|
|
2019-04-10 13:38:41 +00:00
|
|
|
/**
|
|
|
|
* Sign a transaction with the given keystore and previous transactions
|
|
|
|
*
|
|
|
|
* @param mtx The transaction to-be-signed
|
|
|
|
* @param prevTxs Array of previous txns outputs that tx depends on but may not yet be in the block chain
|
|
|
|
* @param keystore Temporary keystore containing signing keys
|
|
|
|
* @param coins Map of unspent outputs - coins in mempool and current chain UTXO set, may be extended by previous txns outputs after call
|
|
|
|
* @param tempKeystore Whether to use temporary keystore
|
|
|
|
* @param hashType The signature hash type
|
|
|
|
* @returns JSON object with details of signed transaction
|
|
|
|
*/
|
|
|
|
UniValue SignTransaction(CMutableTransaction& mtx, const UniValue& prevTxs, CBasicKeyStore* keystore, std::map<COutPoint, Coin>& coins, bool tempKeystore, const UniValue& hashType);
|
2017-06-12 12:23:02 -07:00
|
|
|
|
2018-06-27 17:02:07 -07:00
|
|
|
/** Create a transaction from univalue parameters */
|
|
|
|
CMutableTransaction ConstructTransaction(const UniValue& inputs_in, const UniValue& outputs_in, const UniValue& locktime, const UniValue& rbf);
|
|
|
|
|
2019-04-02 16:51:32 -04:00
|
|
|
#endif // BITCOIN_RPC_RAWTRANSACTION_UTIL_H
|