aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/rawtransaction_util.h
diff options
context:
space:
mode:
authorAntoine Riard <ariard@student.42.fr>2019-04-10 13:38:41 +0000
committerAntoine Riard <ariard@student.42.fr>2019-04-17 08:17:17 -0400
commit99e88a3726c2325e3a3a35c0a750bde25bd58ad0 (patch)
tree050a20cb4577f577def4c79210b886eef72e659f /src/rpc/rawtransaction_util.h
parentc536dfbcb00fb15963bf5d507b7017c241718bf6 (diff)
downloadbitcoin-99e88a3726c2325e3a3a35c0a750bde25bd58ad0.tar.xz
rpc: Remove dependency on interfaces::Chain in SignTransaction
Comment SignTransaction utility
Diffstat (limited to 'src/rpc/rawtransaction_util.h')
-rw-r--r--src/rpc/rawtransaction_util.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/rpc/rawtransaction_util.h b/src/rpc/rawtransaction_util.h
index 5529dedbd4..c115d33a77 100644
--- a/src/rpc/rawtransaction_util.h
+++ b/src/rpc/rawtransaction_util.h
@@ -5,16 +5,26 @@
#ifndef BITCOIN_RPC_RAWTRANSACTION_UTIL_H
#define BITCOIN_RPC_RAWTRANSACTION_UTIL_H
+#include <map>
+
class CBasicKeyStore;
class UniValue;
struct CMutableTransaction;
+class Coin;
+class COutPoint;
-namespace interfaces {
-class Chain;
-} // namespace interfaces
-
-/** Sign a transaction with the given keystore and previous transactions */
-UniValue SignTransaction(interfaces::Chain& chain, CMutableTransaction& mtx, const UniValue& prevTxs, CBasicKeyStore *keystore, bool tempKeystore, const UniValue& hashType);
+/**
+ * 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);
/** Create a transaction from univalue parameters */
CMutableTransaction ConstructTransaction(const UniValue& inputs_in, const UniValue& outputs_in, const UniValue& locktime, const UniValue& rbf);