Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/scriptpubkeyman.cpp
Show First 20 Lines • Show All 1,259 Lines • ▼ Show 20 Lines | for (const CKeyID &id : ordered_pubkeys) { | ||||
AddKeypoolPubkeyWithDB(pubkey, internal, batch); | AddKeypoolPubkeyWithDB(pubkey, internal, batch); | ||||
NotifyCanGetAddressesChanged(); | NotifyCanGetAddressesChanged(); | ||||
} | } | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
bool LegacyScriptPubKeyMan::ImportScriptPubKeys( | bool LegacyScriptPubKeyMan::ImportScriptPubKeys( | ||||
const std::string &label, const std::set<CScript> &script_pub_keys, | const std::set<CScript> &script_pub_keys, const bool have_solving_data, | ||||
const bool have_solving_data, const bool apply_label, | |||||
const int64_t timestamp) { | const int64_t timestamp) { | ||||
WalletBatch batch(m_storage.GetDatabase()); | WalletBatch batch(m_storage.GetDatabase()); | ||||
for (const CScript &script : script_pub_keys) { | for (const CScript &script : script_pub_keys) { | ||||
if (!have_solving_data || !IsMine(script)) { | if (!have_solving_data || !IsMine(script)) { | ||||
// Always call AddWatchOnly for non-solvable watch-only, so that | // Always call AddWatchOnly for non-solvable watch-only, so that | ||||
// watch timestamp gets updated | // watch timestamp gets updated | ||||
if (!AddWatchOnlyWithDB(batch, script, timestamp)) { | if (!AddWatchOnlyWithDB(batch, script, timestamp)) { | ||||
return false; | return false; | ||||
} | } | ||||
} | } | ||||
CTxDestination dest; | |||||
ExtractDestination(script, dest); | |||||
if (apply_label && IsValidDestination(dest)) { | |||||
m_wallet.SetAddressBookWithDB(batch, dest, label, "receive"); | |||||
} | |||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
std::set<CKeyID> LegacyScriptPubKeyMan::GetKeys() const { | std::set<CKeyID> LegacyScriptPubKeyMan::GetKeys() const { | ||||
LOCK(cs_KeyStore); | LOCK(cs_KeyStore); | ||||
if (!IsCrypted()) { | if (!IsCrypted()) { | ||||
return FillableSigningProvider::GetKeys(); | return FillableSigningProvider::GetKeys(); | ||||
Show All 31 Lines |