Add HD keypath to CKeyMetadata, report metadata in validateaddress

https://github.com/bitcoin/bitcoin/pull/8323
This commit is contained in:
lateminer
2018-01-02 14:30:26 +03:00
parent 0e02c74800
commit b741b11cad
5 changed files with 25 additions and 7 deletions

View File

@@ -130,6 +130,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()));