MCPcopy Create free account
hub / github.com/ElementsProject/elements / RemoveWatchOnly

Method RemoveWatchOnly

src/wallet/scriptpubkeyman.cpp:886–905  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

884}
885
886bool LegacyScriptPubKeyMan::RemoveWatchOnly(const CScript &dest)
887{
888 {
889 LOCK(cs_KeyStore);
890 setWatchOnly.erase(dest);
891 CPubKey pubKey;
892 if (ExtractPubKey(dest, pubKey)) {
893 mapWatchKeys.erase(pubKey.GetID());
894 }
895 // Related CScripts are not removed; having superfluous scripts around is
896 // harmless (see comment in ImplicitlyLearnRelatedKeyScripts).
897 }
898
899 if (!HaveWatchOnly())
900 NotifyWatchonlyChanged(false);
901 if (!WalletBatch(m_storage.GetDatabase()).EraseWatchOnly(dest))
902 return false;
903
904 return true;
905}
906
907bool LegacyScriptPubKeyMan::LoadWatchOnly(const CScript &dest)
908{

Callers 1

TestWatchOnlyPubKeyFunction · 0.80

Calls 6

ExtractPubKeyFunction · 0.85
NotifyWatchonlyChangedFunction · 0.85
WalletBatchClass · 0.85
EraseWatchOnlyMethod · 0.80
eraseMethod · 0.45
GetIDMethod · 0.45

Tested by 1

TestWatchOnlyPubKeyFunction · 0.64