Skip to content

Commit fac72fe

Browse files
author
MarcoFalke
committed
remove unused GetAllDestinationsForKey
1 parent fa91d57 commit fac72fe

File tree

3 files changed

+4
-22
lines changed

3 files changed

+4
-22
lines changed

src/outputtype.cpp

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (c) 2009-2010 Satoshi Nakamoto
2-
// Copyright (c) 2009-2022 The Bitcoin Core developers
2+
// Copyright (c) 2009-present The Bitcoin Core developers
33
// Distributed under the MIT software license, see the accompanying
44
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

@@ -9,9 +9,8 @@
99
#include <script/script.h>
1010
#include <script/sign.h>
1111
#include <script/signingprovider.h>
12-
#include <util/vector.h>
1312

14-
#include <assert.h>
13+
#include <cassert>
1514
#include <optional>
1615
#include <string>
1716

@@ -68,19 +67,6 @@ CTxDestination GetDestinationForKey(const CPubKey& key, OutputType type)
6867
assert(false);
6968
}
7069

71-
std::vector<CTxDestination> GetAllDestinationsForKey(const CPubKey& key)
72-
{
73-
PKHash keyid(key);
74-
CTxDestination p2pkh{keyid};
75-
if (key.IsCompressed()) {
76-
CTxDestination segwit = WitnessV0KeyHash(keyid);
77-
CTxDestination p2sh = ScriptHash(GetScriptForDestination(segwit));
78-
return Vector(std::move(p2pkh), std::move(p2sh), std::move(segwit));
79-
} else {
80-
return Vector(std::move(p2pkh));
81-
}
82-
}
83-
8470
CTxDestination AddAndGetDestinationForScript(FlatSigningProvider& keystore, const CScript& script, OutputType type)
8571
{
8672
// Add script to keystore

src/outputtype.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (c) 2009-2010 Satoshi Nakamoto
2-
// Copyright (c) 2009-2022 The Bitcoin Core developers
2+
// Copyright (c) 2009-present The Bitcoin Core developers
33
// Distributed under the MIT software license, see the accompanying
44
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

@@ -38,9 +38,6 @@ const std::string& FormatOutputType(OutputType type);
3838
*/
3939
CTxDestination GetDestinationForKey(const CPubKey& key, OutputType);
4040

41-
/** Get all destinations (potentially) supported by the wallet for the given key. */
42-
std::vector<CTxDestination> GetAllDestinationsForKey(const CPubKey& key);
43-
4441
/**
4542
* Get a destination of the requested type (if possible) to the specified script.
4643
* This function will automatically add the script (and any other

src/test/fuzz/key.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020-2022 The Bitcoin Core developers
1+
// Copyright (c) 2020-present The Bitcoin Core developers
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

@@ -104,7 +104,6 @@ FUZZ_TARGET(key, .init = initialize_key)
104104
assert(pubkey.IsValid());
105105
assert(pubkey.IsFullyValid());
106106
assert(HexToPubKey(HexStr(pubkey)) == pubkey);
107-
assert(GetAllDestinationsForKey(pubkey).size() == 3);
108107
}
109108

110109
{

0 commit comments

Comments
 (0)