Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 1,536 Lines • ▼ Show 20 Lines | Amount CWallet::GetChange(const CTransaction &tx) const { | ||||
} | } | ||||
return nChange; | return nChange; | ||||
} | } | ||||
CPubKey CWallet::GenerateNewHDMasterKey() { | CPubKey CWallet::GenerateNewHDMasterKey() { | ||||
CKey key; | CKey key; | ||||
key.MakeNewKey(true); | key.MakeNewKey(true); | ||||
return DeriveNewMasterHDKey(key); | |||||
} | |||||
CPubKey CWallet::DeriveNewMasterHDKey(const CKey &key) { | |||||
int64_t nCreationTime = GetTime(); | int64_t nCreationTime = GetTime(); | ||||
CKeyMetadata metadata(nCreationTime); | CKeyMetadata metadata(nCreationTime); | ||||
// Calculate the pubkey. | // Calculate the pubkey. | ||||
CPubKey pubkey = key.GetPubKey(); | CPubKey pubkey = key.GetPubKey(); | ||||
assert(key.VerifyPubKey(pubkey)); | assert(key.VerifyPubKey(pubkey)); | ||||
// Set the hd keypath to "m" -> Master, refers the masterkeyid to itself. | // Set the hd keypath to "m" -> Master, refers the masterkeyid to itself. | ||||
▲ Show 20 Lines • Show All 3,202 Lines • Show Last 20 Lines |