Merge pull request #2490 from micaelmalta/1.14.5-dev-key-derivation-path
Change key derivation path to be correct for Dogecoin
This commit is contained in:
commit
523d346857
|
@ -50,7 +50,7 @@ class WalletHDTest(BitcoinTestFramework):
|
|||
for i in range(num_hd_adds):
|
||||
hd_add = self.nodes[1].getnewaddress()
|
||||
hd_info = self.nodes[1].validateaddress(hd_add)
|
||||
assert_equal(hd_info["hdkeypath"], "m/0'/0'/"+str(i+1)+"'")
|
||||
assert_equal(hd_info["hdkeypath"], "m/0'/3'/"+str(i+1)+"'")
|
||||
assert_equal(hd_info["hdmasterkeyid"], masterkeyid)
|
||||
self.nodes[0].sendtoaddress(hd_add, 1)
|
||||
self.nodes[0].generate(1)
|
||||
|
@ -72,7 +72,7 @@ class WalletHDTest(BitcoinTestFramework):
|
|||
for _ in range(num_hd_adds):
|
||||
hd_add_2 = self.nodes[1].getnewaddress()
|
||||
hd_info_2 = self.nodes[1].validateaddress(hd_add_2)
|
||||
assert_equal(hd_info_2["hdkeypath"], "m/0'/0'/"+str(_+1)+"'")
|
||||
assert_equal(hd_info_2["hdkeypath"], "m/0'/3'/"+str(_+1)+"'")
|
||||
assert_equal(hd_info_2["hdmasterkeyid"], masterkeyid)
|
||||
assert_equal(hd_add, hd_add_2)
|
||||
|
||||
|
|
|
@ -150,7 +150,7 @@ void CWallet::DeriveNewChildKey(CKeyMetadata& metadata, CKey& secret)
|
|||
// childIndex | BIP32_HARDENED_KEY_LIMIT = derive childIndex in hardened child-index-range
|
||||
// example: 1 | BIP32_HARDENED_KEY_LIMIT == 0x80000001 == 2147483649
|
||||
externalChainChildKey.Derive(childKey, hdChain.nExternalChainCounter | BIP32_HARDENED_KEY_LIMIT);
|
||||
metadata.hdKeypath = "m/0'/0'/" + std::to_string(hdChain.nExternalChainCounter) + "'";
|
||||
metadata.hdKeypath = "m/0'/3'/" + std::to_string(hdChain.nExternalChainCounter) + "'";
|
||||
metadata.hdMasterKeyID = hdChain.masterKeyID;
|
||||
// increment childkey index
|
||||
hdChain.nExternalChainCounter++;
|
||||
|
|
Loading…
Reference in a new issue