Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/scriptpubkeyman.cpp
Show First 20 Lines • Show All 338 Lines • ▼ Show 20 Lines | bool LegacyScriptPubKeyMan::AddKeyPubKey(const CKey &secret, | ||||
const CPubKey &pubkey) { | const CPubKey &pubkey) { | ||||
WalletBatch batch(m_storage.GetDatabase()); | WalletBatch batch(m_storage.GetDatabase()); | ||||
return LegacyScriptPubKeyMan::AddKeyPubKeyWithDB(batch, secret, pubkey); | return LegacyScriptPubKeyMan::AddKeyPubKeyWithDB(batch, secret, pubkey); | ||||
} | } | ||||
bool LegacyScriptPubKeyMan::AddKeyPubKeyWithDB(WalletBatch &batch, | bool LegacyScriptPubKeyMan::AddKeyPubKeyWithDB(WalletBatch &batch, | ||||
const CKey &secret, | const CKey &secret, | ||||
const CPubKey &pubkey) { | const CPubKey &pubkey) { | ||||
AssertLockHeld(cs_wallet); | |||||
// Make sure we aren't adding private keys to private key disabled wallets | // Make sure we aren't adding private keys to private key disabled wallets | ||||
assert(!m_storage.IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)); | assert(!m_storage.IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)); | ||||
// FillableSigningProvider has no concept of wallet databases, but calls | // FillableSigningProvider has no concept of wallet databases, but calls | ||||
// AddCryptedKey which is overridden below. To avoid flushes, the database | // AddCryptedKey which is overridden below. To avoid flushes, the database | ||||
// handle is tunneled through to it. | // handle is tunneled through to it. | ||||
bool needsDB = !encrypted_batch; | bool needsDB = !encrypted_batch; | ||||
if (needsDB) { | if (needsDB) { | ||||
▲ Show 20 Lines • Show All 950 Lines • Show Last 20 Lines |