[Wallet] extend CKeyMetadata with HD keypath
This commit is contained in:
@@ -126,6 +126,8 @@ CPubKey CWallet::GenerateNewKey()
|
||||
// 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.hdMasterKeyID = hdChain.masterKeyID;
|
||||
// increment childkey index
|
||||
hdChain.nExternalChainCounter++;
|
||||
} while(HaveKey(childKey.key.GetPubKey().GetID()));
|
||||
|
||||
Reference in New Issue
Block a user