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

Method ImportScripts

src/wallet/scriptpubkeyman.cpp:1562–1584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1560}
1561
1562bool LegacyScriptPubKeyMan::ImportScripts(const std::set<CScript> scripts, int64_t timestamp)
1563{
1564 WalletBatch batch(m_storage.GetDatabase());
1565 for (const auto& entry : scripts) {
1566 CScriptID id(entry);
1567 if (HaveCScript(id)) {
1568 WalletLogPrintf("Already have script %s, skipping\n", HexStr(entry));
1569 continue;
1570 }
1571 if (!AddCScriptWithDB(batch, entry)) {
1572 return false;
1573 }
1574
1575 if (timestamp > 0) {
1576 m_script_metadata[CScriptID(entry)].nCreateTime = timestamp;
1577 }
1578 }
1579 if (timestamp > 0) {
1580 UpdateTimeFirstKey(timestamp);
1581 }
1582
1583 return true;
1584}
1585
1586bool LegacyScriptPubKeyMan::ImportPrivKeys(const std::map<CKeyID, CKey>& privkey_map, const int64_t timestamp)
1587{

Callers

nothing calls this directly

Calls 2

CScriptIDClass · 0.85
HexStrFunction · 0.50

Tested by

no test coverage detected