remove unused GetAllDestinationsForKey
This commit is contained in:
3 files changed
+4
-22
No files matched your search
+2
-16
@@ -1,5 +1,5 @@
|
|||||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||||
// Copyright (c) 2009-2022 The Bitcoin Core developers
|
// Copyright (c) 2009-present The Bitcoin Core developers
|
||||||
// Distributed under the MIT software license, see the accompanying
|
// Distributed under the MIT software license, see the accompanying
|
||||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
@@ -9,9 +9,8 @@
|
|||||||
#include <script/script.h>
|
#include <script/script.h>
|
||||||
#include <script/sign.h>
|
#include <script/sign.h>
|
||||||
#include <script/signingprovider.h>
|
#include <script/signingprovider.h>
|
||||||
#include <util/vector.h>
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <cassert>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@@ -68,19 +67,6 @@ CTxDestination GetDestinationForKey(const CPubKey& key, OutputType type)
|
|||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<CTxDestination> GetAllDestinationsForKey(const CPubKey& key)
|
|
||||||
{
|
|
||||||
PKHash keyid(key);
|
|
||||||
CTxDestination p2pkh{keyid};
|
|
||||||
if (key.IsCompressed()) {
|
|
||||||
CTxDestination segwit = WitnessV0KeyHash(keyid);
|
|
||||||
CTxDestination p2sh = ScriptHash(GetScriptForDestination(segwit));
|
|
||||||
return Vector(std::move(p2pkh), std::move(p2sh), std::move(segwit));
|
|
||||||
} else {
|
|
||||||
return Vector(std::move(p2pkh));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CTxDestination AddAndGetDestinationForScript(FlatSigningProvider& keystore, const CScript& script, OutputType type)
|
CTxDestination AddAndGetDestinationForScript(FlatSigningProvider& keystore, const CScript& script, OutputType type)
|
||||||
{
|
{
|
||||||
// Add script to keystore
|
// Add script to keystore
|
||||||
|
|||||||
+1
-4
@@ -1,5 +1,5 @@
|
|||||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||||
// Copyright (c) 2009-2022 The Bitcoin Core developers
|
// Copyright (c) 2009-present The Bitcoin Core developers
|
||||||
// Distributed under the MIT software license, see the accompanying
|
// Distributed under the MIT software license, see the accompanying
|
||||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
@@ -38,9 +38,6 @@ const std::string& FormatOutputType(OutputType type);
|
|||||||
*/
|
*/
|
||||||
CTxDestination GetDestinationForKey(const CPubKey& key, OutputType);
|
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.
|
* Get a destination of the requested type (if possible) to the specified script.
|
||||||
* This function will automatically add the script (and any other
|
* This function will automatically add the script (and any other
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2020-2022 The Bitcoin Core developers
|
// Copyright (c) 2020-present The Bitcoin Core developers
|
||||||
// Distributed under the MIT software license, see the accompanying
|
// Distributed under the MIT software license, see the accompanying
|
||||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
@@ -104,7 +104,6 @@ FUZZ_TARGET(key, .init = initialize_key)
|
|||||||
assert(pubkey.IsValid());
|
assert(pubkey.IsValid());
|
||||||
assert(pubkey.IsFullyValid());
|
assert(pubkey.IsFullyValid());
|
||||||
assert(HexToPubKey(HexStr(pubkey)) == pubkey);
|
assert(HexToPubKey(HexStr(pubkey)) == pubkey);
|
||||||
assert(GetAllDestinationsForKey(pubkey).size() == 3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user