diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2018-07-20 00:04:02 -0700 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2018-08-13 08:46:23 -0700 |
commit | 81e1dd5ce1a32114a38691ec6b55e72ab04dbbb1 (patch) | |
tree | 5342792dd281e8628ebc214feca9e74d80770e79 /src/script/sign.cpp | |
parent | 84f1f1bfdf900cd28099e428441aa42f9d11a0ed (diff) |
Generalize PublicOnlySigningProvider into HidingSigningProvider
Diffstat (limited to 'src/script/sign.cpp')
-rw-r--r-- | src/script/sign.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/script/sign.cpp b/src/script/sign.cpp index 47931e21d9..ae29f72b05 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -640,18 +640,25 @@ void PSBTOutput::Merge(const PSBTOutput& output) if (witness_script.empty() && !output.witness_script.empty()) witness_script = output.witness_script; } -bool PublicOnlySigningProvider::GetCScript(const CScriptID &scriptid, CScript& script) const +bool HidingSigningProvider::GetCScript(const CScriptID& scriptid, CScript& script) const { return m_provider->GetCScript(scriptid, script); } -bool PublicOnlySigningProvider::GetPubKey(const CKeyID& keyid, CPubKey& pubkey) const +bool HidingSigningProvider::GetPubKey(const CKeyID& keyid, CPubKey& pubkey) const { return m_provider->GetPubKey(keyid, pubkey); } -bool PublicOnlySigningProvider::GetKeyOrigin(const CKeyID& keyid, KeyOriginInfo& info) const +bool HidingSigningProvider::GetKey(const CKeyID& keyid, CKey& key) const { + if (m_hide_secret) return false; + return m_provider->GetKey(keyid, key); +} + +bool HidingSigningProvider::GetKeyOrigin(const CKeyID& keyid, KeyOriginInfo& info) const +{ + if (m_hide_origin) return false; return m_provider->GetKeyOrigin(keyid, info); } |