aboutsummaryrefslogtreecommitdiff
path: root/src/core_io.h
diff options
context:
space:
mode:
authorAntoine Poinsot <darosior@protonmail.com>2023-02-03 17:44:22 +0100
committerAntoine Poinsot <darosior@protonmail.com>2023-02-03 18:15:42 +0100
commitdfc9acbf0170bde6f2abb879b5584dabd1266531 (patch)
treeb48e36e113db1f3d97ae1746c4bfb51f335e25cc /src/core_io.h
parentaaa55971f6af3f19b22c28103630b856df266ebb (diff)
rpc: decode Miniscript descriptor when possible in decodescript
The descriptor inference logic would previously always use a dummy signing provider and would never analyze the witness script of a P2WSH scriptPubKey. Note even a valid Miniscript might not always be decodable from Script without more contextual information (for instance the key preimage for a pk_h).
Diffstat (limited to 'src/core_io.h')
-rw-r--r--src/core_io.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core_io.h b/src/core_io.h
index 33e1ad82fc..997f3bfd5b 100644
--- a/src/core_io.h
+++ b/src/core_io.h
@@ -15,6 +15,7 @@ class CBlockHeader;
class CScript;
class CTransaction;
struct CMutableTransaction;
+class SigningProvider;
class uint256;
class UniValue;
class CTxUndo;
@@ -52,7 +53,7 @@ UniValue ValueFromAmount(const CAmount amount);
std::string FormatScript(const CScript& script);
std::string EncodeHexTx(const CTransaction& tx, const int serializeFlags = 0);
std::string SighashToStr(unsigned char sighash_type);
-void ScriptToUniv(const CScript& script, UniValue& out, bool include_hex = true, bool include_address = false);
+void ScriptToUniv(const CScript& script, UniValue& out, bool include_hex = true, bool include_address = false, const SigningProvider* provider = nullptr);
void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry, bool include_hex = true, int serialize_flags = 0, const CTxUndo* txundo = nullptr, TxVerbosity verbosity = TxVerbosity::SHOW_DETAILS);
#endif // BITCOIN_CORE_IO_H