Skip to content

Commit 131d445

Browse files
committed
scripted-diff: Rename master key to seed
-BEGIN VERIFY SCRIPT- ren() { git grep -l "\<$1\>" 'src/*.cpp' 'src/*.h' test | xargs sed -i "s:\<$1\>:$2:g"; } ren GenerateNewHDMasterKey GenerateNewSeed ren DeriveNewMasterHDKey DeriveNewSeed ren SetHDMasterKey SetHDSeed ren hdMasterKeyID hd_seed_id ren masterKeyID seed_id ren SetMaster SetSeed ren hdmasterkeyid hdseedid ren hdmaster hdseed -END VERIFY SCRIPT-
1 parent d792e47 commit 131d445

File tree

11 files changed

+57
-57
lines changed

11 files changed

+57
-57
lines changed

src/key.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ bool CExtKey::Derive(CExtKey &out, unsigned int _nChild) const {
273273
return key.Derive(out.key, out.chaincode, _nChild, chaincode);
274274
}
275275

276-
void CExtKey::SetMaster(const unsigned char *seed, unsigned int nSeedLen) {
276+
void CExtKey::SetSeed(const unsigned char *seed, unsigned int nSeedLen) {
277277
static const unsigned char hashkey[] = {'B','i','t','c','o','i','n',' ','s','e','e','d'};
278278
std::vector<unsigned char, secure_allocator<unsigned char>> vout(64);
279279
CHMAC_SHA512(hashkey, sizeof(hashkey)).Write(seed, nSeedLen).Finalize(vout.data());

src/key.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ struct CExtKey {
158158
void Decode(const unsigned char code[BIP32_EXTKEY_SIZE]);
159159
bool Derive(CExtKey& out, unsigned int nChild) const;
160160
CExtPubKey Neuter() const;
161-
void SetMaster(const unsigned char* seed, unsigned int nSeedLen);
161+
void SetSeed(const unsigned char* seed, unsigned int nSeedLen);
162162
template <typename Stream>
163163
void Serialize(Stream& s) const
164164
{

src/test/bip32_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static void RunTest(const TestVector &test) {
9191
std::vector<unsigned char> seed = ParseHex(test.strHexMaster);
9292
CExtKey key;
9393
CExtPubKey pubkey;
94-
key.SetMaster(seed.data(), seed.size());
94+
key.SetSeed(seed.data(), seed.size());
9595
pubkey = key.Neuter();
9696
for (const TestDerivation &derive : test.vDerive) {
9797
unsigned char data[74];

src/wallet/rpcdump.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -752,13 +752,13 @@ UniValue dumpwallet(const JSONRPCRequest& request)
752752
file << "\n";
753753

754754
// add the base58check encoded extended master if the wallet uses HD
755-
CKeyID masterKeyID = pwallet->GetHDChain().masterKeyID;
756-
if (!masterKeyID.IsNull())
755+
CKeyID seed_id = pwallet->GetHDChain().seed_id;
756+
if (!seed_id.IsNull())
757757
{
758758
CKey key;
759-
if (pwallet->GetKey(masterKeyID, key)) {
759+
if (pwallet->GetKey(seed_id, key)) {
760760
CExtKey masterKey;
761-
masterKey.SetMaster(key.begin(), key.size());
761+
masterKey.SetSeed(key.begin(), key.size());
762762

763763
file << "# extended private masterkey: " << EncodeExtKey(masterKey) << "\n\n";
764764
}
@@ -773,8 +773,8 @@ UniValue dumpwallet(const JSONRPCRequest& request)
773773
file << strprintf("%s %s ", EncodeSecret(key), strTime);
774774
if (GetWalletAddressesForKey(pwallet, keyid, strAddr, strLabel)) {
775775
file << strprintf("label=%s", strLabel);
776-
} else if (keyid == masterKeyID) {
777-
file << "hdmaster=1";
776+
} else if (keyid == seed_id) {
777+
file << "hdseed=1";
778778
} else if (mapKeyPool.count(keyid)) {
779779
file << "reserve=1";
780780
} else if (pwallet->mapKeyMetadata[keyid].hdKeypath == "m") {

src/wallet/rpcwallet.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2925,7 +2925,7 @@ static UniValue getwalletinfo(const JSONRPCRequest& request)
29252925
" \"keypoolsize_hd_internal\": xxxx, (numeric) how many new keys are pre-generated for internal use (used for change outputs, only appears if the wallet is using this feature, otherwise external keys are used)\n"
29262926
" \"unlocked_until\": ttt, (numeric) the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked\n"
29272927
" \"paytxfee\": x.xxxx, (numeric) the transaction fee configuration, set in " + CURRENCY_UNIT + "/kB\n"
2928-
" \"hdmasterkeyid\": \"<hash160>\" (string, optional) the Hash160 of the HD master pubkey (only present when HD is enabled)\n"
2928+
" \"hdseedid\": \"<hash160>\" (string, optional) the Hash160 of the HD master pubkey (only present when HD is enabled)\n"
29292929
"}\n"
29302930
"\nExamples:\n"
29312931
+ HelpExampleCli("getwalletinfo", "")
@@ -2949,16 +2949,16 @@ static UniValue getwalletinfo(const JSONRPCRequest& request)
29492949
obj.pushKV("txcount", (int)pwallet->mapWallet.size());
29502950
obj.pushKV("keypoololdest", pwallet->GetOldestKeyPoolTime());
29512951
obj.pushKV("keypoolsize", (int64_t)kpExternalSize);
2952-
CKeyID masterKeyID = pwallet->GetHDChain().masterKeyID;
2953-
if (!masterKeyID.IsNull() && pwallet->CanSupportFeature(FEATURE_HD_SPLIT)) {
2952+
CKeyID seed_id = pwallet->GetHDChain().seed_id;
2953+
if (!seed_id.IsNull() && pwallet->CanSupportFeature(FEATURE_HD_SPLIT)) {
29542954
obj.pushKV("keypoolsize_hd_internal", (int64_t)(pwallet->GetKeyPoolSize() - kpExternalSize));
29552955
}
29562956
if (pwallet->IsCrypted()) {
29572957
obj.pushKV("unlocked_until", pwallet->nRelockTime);
29582958
}
29592959
obj.pushKV("paytxfee", ValueFromAmount(pwallet->m_pay_tx_fee.GetFeePerK()));
2960-
if (!masterKeyID.IsNull())
2961-
obj.pushKV("hdmasterkeyid", masterKeyID.GetHex());
2960+
if (!seed_id.IsNull())
2961+
obj.pushKV("hdseedid", seed_id.GetHex());
29622962
return obj;
29632963
}
29642964

@@ -3948,13 +3948,13 @@ UniValue getaddressinfo(const JSONRPCRequest& request)
39483948
" ]\n"
39493949
" \"sigsrequired\" : xxxxx (numeric, optional) Number of signatures required to spend multisig output (only if \"script\" is \"multisig\")\n"
39503950
" \"pubkey\" : \"publickeyhex\", (string, optional) The hex value of the raw public key, for single-key addresses (possibly embedded in P2SH or P2WSH)\n"
3951-
" \"embedded\" : {...}, (object, optional) Information about the address embedded in P2SH or P2WSH, if relevant and known. It includes all getaddressinfo output fields for the embedded address, excluding metadata (\"timestamp\", \"hdkeypath\", \"hdmasterkeyid\") and relation to the wallet (\"ismine\", \"iswatchonly\", \"account\").\n"
3951+
" \"embedded\" : {...}, (object, optional) Information about the address embedded in P2SH or P2WSH, if relevant and known. It includes all getaddressinfo output fields for the embedded address, excluding metadata (\"timestamp\", \"hdkeypath\", \"hdseedid\") and relation to the wallet (\"ismine\", \"iswatchonly\", \"account\").\n"
39523952
" \"iscompressed\" : true|false, (boolean) If the address is compressed\n"
39533953
" \"label\" : \"label\" (string) The label associated with the address, \"\" is the default account\n"
39543954
" \"account\" : \"account\" (string) DEPRECATED. This field will be removed in V0.18. To see this deprecated field, start bitcoind with -deprecatedrpc=accounts. The account associated with the address, \"\" is the default account\n"
39553955
" \"timestamp\" : timestamp, (number, optional) The creation time of the key if available in seconds since epoch (Jan 1 1970 GMT)\n"
39563956
" \"hdkeypath\" : \"keypath\" (string, optional) The HD keypath if the key is HD and available\n"
3957-
" \"hdmasterkeyid\" : \"<hash160>\" (string, optional) The Hash160 of the HD master pubkey\n"
3957+
" \"hdseedid\" : \"<hash160>\" (string, optional) The Hash160 of the HD master pubkey\n"
39583958
" \"labels\" (object) Array of labels associated with the address.\n"
39593959
" [\n"
39603960
" { (json object of label data)\n"
@@ -4014,7 +4014,7 @@ UniValue getaddressinfo(const JSONRPCRequest& request)
40144014
ret.pushKV("timestamp", meta->nCreateTime);
40154015
if (!meta->hdKeypath.empty()) {
40164016
ret.pushKV("hdkeypath", meta->hdKeypath);
4017-
ret.pushKV("hdmasterkeyid", meta->hdMasterKeyID.GetHex());
4017+
ret.pushKV("hdseedid", meta->hd_seed_id.GetHex());
40184018
}
40194019
}
40204020

@@ -4147,7 +4147,7 @@ UniValue sethdseed(const JSONRPCRequest& request)
41474147
" If false, addresses (including change addresses if the wallet already had HD Chain Split enabled) from the existing\n"
41484148
" keypool will be used until it has been depleted.\n"
41494149
"2. \"seed\" (string, optional) The WIF private key to use as the new HD seed; if not provided a random seed will be used.\n"
4150-
" The seed value can be retrieved using the dumpwallet command. It is the private key marked hdmaster=1\n"
4150+
" The seed value can be retrieved using the dumpwallet command. It is the private key marked hdseed=1\n"
41514151
"\nExamples:\n"
41524152
+ HelpExampleCli("sethdseed", "")
41534153
+ HelpExampleCli("sethdseed", "false")
@@ -4176,7 +4176,7 @@ UniValue sethdseed(const JSONRPCRequest& request)
41764176

41774177
CPubKey master_pub_key;
41784178
if (request.params[1].isNull()) {
4179-
master_pub_key = pwallet->GenerateNewHDMasterKey();
4179+
master_pub_key = pwallet->GenerateNewSeed();
41804180
} else {
41814181
CKey key = DecodeSecret(request.params[1].get_str());
41824182
if (!key.IsValid()) {
@@ -4187,10 +4187,10 @@ UniValue sethdseed(const JSONRPCRequest& request)
41874187
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Already have this key (either as an HD seed or as a loose private key)");
41884188
}
41894189

4190-
master_pub_key = pwallet->DeriveNewMasterHDKey(key);
4190+
master_pub_key = pwallet->DeriveNewSeed(key);
41914191
}
41924192

4193-
pwallet->SetHDMasterKey(master_pub_key);
4193+
pwallet->SetHDSeed(master_pub_key);
41944194
if (flush_key_pool) pwallet->NewKeyPool();
41954195

41964196
return NullUniValue;

src/wallet/wallet.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,10 @@ void CWallet::DeriveNewChildKey(WalletBatch &batch, CKeyMetadata& metadata, CKey
198198
CExtKey childKey; //key at m/0'/0'/<n>'
199199

200200
// try to get the master key
201-
if (!GetKey(hdChain.masterKeyID, key))
201+
if (!GetKey(hdChain.seed_id, key))
202202
throw std::runtime_error(std::string(__func__) + ": Master key not found");
203203

204-
masterKey.SetMaster(key.begin(), key.size());
204+
masterKey.SetSeed(key.begin(), key.size());
205205

206206
// derive m/0'
207207
// use hardened derivation (child keys >= 0x80000000 are hardened after bip32)
@@ -228,7 +228,7 @@ void CWallet::DeriveNewChildKey(WalletBatch &batch, CKeyMetadata& metadata, CKey
228228
}
229229
} while (HaveKey(childKey.key.GetPubKey().GetID()));
230230
secret = childKey.key;
231-
metadata.hdMasterKeyID = hdChain.masterKeyID;
231+
metadata.hd_seed_id = hdChain.seed_id;
232232
// update the chain model in the database
233233
if (!batch.WriteHDChain(hdChain))
234234
throw std::runtime_error(std::string(__func__) + ": Writing HD chain model failed");
@@ -691,7 +691,7 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase)
691691

692692
// if we are using HD, replace the HD master key (seed) with a new one
693693
if (IsHDEnabled()) {
694-
if (!SetHDMasterKey(GenerateNewHDMasterKey())) {
694+
if (!SetHDSeed(GenerateNewSeed())) {
695695
return false;
696696
}
697697
}
@@ -1450,14 +1450,14 @@ CAmount CWallet::GetChange(const CTransaction& tx) const
14501450
return nChange;
14511451
}
14521452

1453-
CPubKey CWallet::GenerateNewHDMasterKey()
1453+
CPubKey CWallet::GenerateNewSeed()
14541454
{
14551455
CKey key;
14561456
key.MakeNewKey(true);
1457-
return DeriveNewMasterHDKey(key);
1457+
return DeriveNewSeed(key);
14581458
}
14591459

1460-
CPubKey CWallet::DeriveNewMasterHDKey(const CKey& key)
1460+
CPubKey CWallet::DeriveNewSeed(const CKey& key)
14611461
{
14621462
int64_t nCreationTime = GetTime();
14631463
CKeyMetadata metadata(nCreationTime);
@@ -1468,7 +1468,7 @@ CPubKey CWallet::DeriveNewMasterHDKey(const CKey& key)
14681468

14691469
// set the hd keypath to "m" -> Master, refers the masterkeyid to itself
14701470
metadata.hdKeypath = "m";
1471-
metadata.hdMasterKeyID = pubkey.GetID();
1471+
metadata.hd_seed_id = pubkey.GetID();
14721472

14731473
{
14741474
LOCK(cs_wallet);
@@ -1484,15 +1484,15 @@ CPubKey CWallet::DeriveNewMasterHDKey(const CKey& key)
14841484
return pubkey;
14851485
}
14861486

1487-
bool CWallet::SetHDMasterKey(const CPubKey& pubkey)
1487+
bool CWallet::SetHDSeed(const CPubKey& pubkey)
14881488
{
14891489
LOCK(cs_wallet);
14901490
// store the keyid (hash160) together with
14911491
// the child index counter in the database
14921492
// as a hdchain object
14931493
CHDChain newHdChain;
14941494
newHdChain.nVersion = CanSupportFeature(FEATURE_HD_SPLIT) ? CHDChain::VERSION_HD_CHAIN_SPLIT : CHDChain::VERSION_HD_BASE;
1495-
newHdChain.masterKeyID = pubkey.GetID();
1495+
newHdChain.seed_id = pubkey.GetID();
14961496
SetHDChain(newHdChain, false);
14971497

14981498
return true;
@@ -1510,7 +1510,7 @@ bool CWallet::SetHDChain(const CHDChain& chain, bool memonly)
15101510

15111511
bool CWallet::IsHDEnabled() const
15121512
{
1513-
return !hdChain.masterKeyID.IsNull();
1513+
return !hdChain.seed_id.IsNull();
15141514
}
15151515

15161516
int64_t CWalletTx::GetTxTime() const
@@ -4130,8 +4130,8 @@ CWallet* CWallet::CreateWalletFromFile(const std::string& name, const fs::path&
41304130
walletInstance->SetMinVersion(FEATURE_HD);
41314131

41324132
// generate a new master key
4133-
CPubKey masterPubKey = walletInstance->GenerateNewHDMasterKey();
4134-
if (!walletInstance->SetHDMasterKey(masterPubKey)) {
4133+
CPubKey masterPubKey = walletInstance->GenerateNewSeed();
4134+
if (!walletInstance->SetHDSeed(masterPubKey)) {
41354135
throw std::runtime_error(std::string(__func__) + ": Storing master key failed");
41364136
}
41374137
hd_upgrade = true;
@@ -4165,8 +4165,8 @@ CWallet* CWallet::CreateWalletFromFile(const std::string& name, const fs::path&
41654165
walletInstance->SetMinVersion(FEATURE_LATEST);
41664166

41674167
// generate a new master key
4168-
CPubKey masterPubKey = walletInstance->GenerateNewHDMasterKey();
4169-
if (!walletInstance->SetHDMasterKey(masterPubKey))
4168+
CPubKey masterPubKey = walletInstance->GenerateNewSeed();
4169+
if (!walletInstance->SetHDSeed(masterPubKey))
41704170
throw std::runtime_error(std::string(__func__) + ": Storing master key failed");
41714171

41724172
// Top up the keypool

src/wallet/wallet.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,16 +1140,16 @@ class CWallet final : public CCryptoKeyStore, public CValidationInterface
11401140
bool IsHDEnabled() const;
11411141

11421142
/* Generates a new HD master key (will not be activated) */
1143-
CPubKey GenerateNewHDMasterKey();
1143+
CPubKey GenerateNewSeed();
11441144

11451145
/* Derives a new HD master key (will not be activated) */
1146-
CPubKey DeriveNewMasterHDKey(const CKey& key);
1146+
CPubKey DeriveNewSeed(const CKey& key);
11471147

11481148
/* Set the current HD master key (will reset the chain child index counters)
11491149
Sets the master key's version based on the current wallet version (so the
11501150
caller must ensure the current wallet version is correct before calling
11511151
this function). */
1152-
bool SetHDMasterKey(const CPubKey& key);
1152+
bool SetHDSeed(const CPubKey& key);
11531153

11541154
/**
11551155
* Blocks until the wallet state is up-to-date to /at least/ the current

src/wallet/walletdb.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class CHDChain
6262
public:
6363
uint32_t nExternalChainCounter;
6464
uint32_t nInternalChainCounter;
65-
CKeyID masterKeyID; //!< master key hash160
65+
CKeyID seed_id; //!< master key hash160
6666

6767
static const int VERSION_HD_BASE = 1;
6868
static const int VERSION_HD_CHAIN_SPLIT = 2;
@@ -76,7 +76,7 @@ class CHDChain
7676
{
7777
READWRITE(this->nVersion);
7878
READWRITE(nExternalChainCounter);
79-
READWRITE(masterKeyID);
79+
READWRITE(seed_id);
8080
if (this->nVersion >= VERSION_HD_CHAIN_SPLIT)
8181
READWRITE(nInternalChainCounter);
8282
}
@@ -86,7 +86,7 @@ class CHDChain
8686
nVersion = CHDChain::CURRENT_VERSION;
8787
nExternalChainCounter = 0;
8888
nInternalChainCounter = 0;
89-
masterKeyID.SetNull();
89+
seed_id.SetNull();
9090
}
9191
};
9292

@@ -99,7 +99,7 @@ class CKeyMetadata
9999
int nVersion;
100100
int64_t nCreateTime; // 0 means unknown
101101
std::string hdKeypath; //optional HD/bip32 keypath
102-
CKeyID hdMasterKeyID; //id of the HD masterkey used to derive this key
102+
CKeyID hd_seed_id; //id of the HD masterkey used to derive this key
103103

104104
CKeyMetadata()
105105
{
@@ -120,7 +120,7 @@ class CKeyMetadata
120120
if (this->nVersion >= VERSION_WITH_HDDATA)
121121
{
122122
READWRITE(hdKeypath);
123-
READWRITE(hdMasterKeyID);
123+
READWRITE(hd_seed_id);
124124
}
125125
}
126126

@@ -129,7 +129,7 @@ class CKeyMetadata
129129
nVersion = CKeyMetadata::CURRENT_VERSION;
130130
nCreateTime = 0;
131131
hdKeypath.clear();
132-
hdMasterKeyID.SetNull();
132+
hd_seed_id.SetNull();
133133
}
134134
};
135135

test/functional/wallet_dump.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def read_dump(file_name, addrs, script_addrs, hd_master_addr_old):
3939
if keytype == "inactivehdmaster=1":
4040
# ensure the old master is still available
4141
assert(hd_master_addr_old == addr)
42-
elif keytype == "hdmaster=1":
42+
elif keytype == "hdseed=1":
4343
# ensure we have generated a new hd master key
4444
assert(hd_master_addr_old != addr)
4545
hd_master_addr_ret = addr

test/functional/wallet_hd.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def run_test(self):
2929
connect_nodes_bi(self.nodes, 0, 1)
3030

3131
# Make sure we use hd, keep masterkeyid
32-
masterkeyid = self.nodes[1].getwalletinfo()['hdmasterkeyid']
32+
masterkeyid = self.nodes[1].getwalletinfo()['hdseedid']
3333
assert_equal(len(masterkeyid), 40)
3434

3535
# create an internal key
@@ -54,7 +54,7 @@ def run_test(self):
5454
hd_add = self.nodes[1].getnewaddress()
5555
hd_info = self.nodes[1].getaddressinfo(hd_add)
5656
assert_equal(hd_info["hdkeypath"], "m/0'/0'/"+str(i)+"'")
57-
assert_equal(hd_info["hdmasterkeyid"], masterkeyid)
57+
assert_equal(hd_info["hdseedid"], masterkeyid)
5858
self.nodes[0].sendtoaddress(hd_add, 1)
5959
self.nodes[0].generate(1)
6060
self.nodes[0].sendtoaddress(non_hd_add, 1)
@@ -83,7 +83,7 @@ def run_test(self):
8383
hd_add_2 = self.nodes[1].getnewaddress()
8484
hd_info_2 = self.nodes[1].getaddressinfo(hd_add_2)
8585
assert_equal(hd_info_2["hdkeypath"], "m/0'/0'/"+str(i)+"'")
86-
assert_equal(hd_info_2["hdmasterkeyid"], masterkeyid)
86+
assert_equal(hd_info_2["hdseedid"], masterkeyid)
8787
assert_equal(hd_add, hd_add_2)
8888
connect_nodes_bi(self.nodes, 0, 1)
8989
self.sync_all()
@@ -122,9 +122,9 @@ def run_test(self):
122122
assert_equal(keypath[0:7], "m/0'/1'")
123123

124124
# Generate a new HD seed on node 1 and make sure it is set
125-
orig_masterkeyid = self.nodes[1].getwalletinfo()['hdmasterkeyid']
125+
orig_masterkeyid = self.nodes[1].getwalletinfo()['hdseedid']
126126
self.nodes[1].sethdseed()
127-
new_masterkeyid = self.nodes[1].getwalletinfo()['hdmasterkeyid']
127+
new_masterkeyid = self.nodes[1].getwalletinfo()['hdseedid']
128128
assert orig_masterkeyid != new_masterkeyid
129129
addr = self.nodes[1].getnewaddress()
130130
assert_equal(self.nodes[1].getaddressinfo(addr)['hdkeypath'], 'm/0\'/0\'/0\'') # Make sure the new address is the first from the keypool
@@ -134,16 +134,16 @@ def run_test(self):
134134
new_seed = self.nodes[0].dumpprivkey(self.nodes[0].getnewaddress())
135135
orig_masterkeyid = new_masterkeyid
136136
self.nodes[1].sethdseed(False, new_seed)
137-
new_masterkeyid = self.nodes[1].getwalletinfo()['hdmasterkeyid']
137+
new_masterkeyid = self.nodes[1].getwalletinfo()['hdseedid']
138138
assert orig_masterkeyid != new_masterkeyid
139139
addr = self.nodes[1].getnewaddress()
140-
assert_equal(orig_masterkeyid, self.nodes[1].getaddressinfo(addr)['hdmasterkeyid'])
140+
assert_equal(orig_masterkeyid, self.nodes[1].getaddressinfo(addr)['hdseedid'])
141141
assert_equal(self.nodes[1].getaddressinfo(addr)['hdkeypath'], 'm/0\'/0\'/1\'') # Make sure the new address continues previous keypool
142142

143143
# Check that the next address is from the new seed
144144
self.nodes[1].keypoolrefill(1)
145145
next_addr = self.nodes[1].getnewaddress()
146-
assert_equal(new_masterkeyid, self.nodes[1].getaddressinfo(next_addr)['hdmasterkeyid'])
146+
assert_equal(new_masterkeyid, self.nodes[1].getaddressinfo(next_addr)['hdseedid'])
147147
assert_equal(self.nodes[1].getaddressinfo(next_addr)['hdkeypath'], 'm/0\'/0\'/0\'') # Make sure the new address is not from previous keypool
148148
assert next_addr != addr
149149

0 commit comments

Comments
 (0)