--- bitcoin-03422e564b552c1d3c16ae854f8471f7cb39e25d/src/wallet/wallet.cpp +++ bitcoin-0.13.1-cxx11/src/wallet/wallet.cpp @@ -134,7 +134,13 @@ 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); +#if defined(__GNUG__) && __GNUG__ < 5 + char hdkp[9+10+1]; + std::sprintf(hdkp, "m/0'/0'/%i'", hdChain.nExternalChainCounter); + metadata.hdKeypath = hdkp; +#else metadata.hdKeypath = "m/0'/0'/"+std::to_string(hdChain.nExternalChainCounter)+"'"; +#endif metadata.hdMasterKeyID = hdChain.masterKeyID; // increment childkey index hdChain.nExternalChainCounter++;