diff options
author | Anthony Towns <aj@erisian.com.au> | 2018-07-09 19:30:39 +1000 |
---|---|---|
committer | Anthony Towns <aj@erisian.com.au> | 2018-07-10 00:06:19 +1000 |
commit | d58055d25f41e942e04ffeae5f25e37a60ee8829 (patch) | |
tree | b672c2f0cdb88537a9112d7b750b65589c0b9853 /src/outputtype.h | |
parent | 9a44db2e46af2b73e0dbaa929244161b18c15162 (diff) | |
download | bitcoin-d58055d25f41e942e04ffeae5f25e37a60ee8829.tar.xz |
Move AddAndGetDestinationForScript from wallet to outputype module
Makes AddAndGetDestinationForScript use a generic CKeyStore rather than
the wallet, and makes it always add the script to the keystore, rather
than only adding related (redeem) scripts.
Diffstat (limited to 'src/outputtype.h')
-rw-r--r-- | src/outputtype.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/outputtype.h b/src/outputtype.h index 0c55ac9b18..21623e3b49 100644 --- a/src/outputtype.h +++ b/src/outputtype.h @@ -6,6 +6,7 @@ #ifndef BITCOIN_OUTPUTTYPE_H #define BITCOIN_OUTPUTTYPE_H +#include <keystore.h> #include <script/standard.h> #include <string> @@ -37,5 +38,12 @@ CTxDestination GetDestinationForKey(const CPubKey& key, OutputType); /** Get all destinations (potentially) supported by the wallet for the given key. */ std::vector<CTxDestination> GetAllDestinationsForKey(const CPubKey& key); +/** + * Get a destination of the requested type (if possible) to the specified script. + * This function will automatically add the script (and any other + * necessary scripts) to the keystore. + */ +CTxDestination AddAndGetDestinationForScript(CKeyStore& keystore, const CScript& script, OutputType); + #endif // BITCOIN_OUTPUTTYPE_H |