aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2016-07-09 11:41:01 +0200
committerJonas Schnelli <dev@jonasschnelli.ch>2016-07-09 11:52:17 +0200
commit5b95dd2c256dd7ba3808021adc31bb85b41553c8 (patch)
treeabde39c27d37dcf802c92633faa8c4b1c9dbaf83 /src/wallet/wallet.cpp
parent67caef673089aca2ffb95cd15b2cb056c96e5c30 (diff)
downloadbitcoin-5b95dd2c256dd7ba3808021adc31bb85b41553c8.tar.xz
[Wallet] extend CKeyMetadata with HD keypath
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index a0095ebd92..33e516a7f4 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -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()));