MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / UpdateWithSigningProvider

Method UpdateWithSigningProvider

src/wallet/scriptpubkeyman.cpp:1618–1633  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1616}
1617
1618void DescriptorScriptPubKeyMan::UpdateWithSigningProvider(WalletBatch& batch, const FlatSigningProvider& signing_provider)
1619{
1620 AssertLockHeld(cs_desc_man);
1621 // Add the private keys to the descriptor
1622 for (const auto& entry : signing_provider.keys) {
1623 const CKey& key = entry.second;
1624 if (!AddDescriptorKeyWithDB(batch, key, key.GetPubKey())) {
1625 throw std::runtime_error(std::string(__func__) + ": writing descriptor private key failed");
1626 }
1627 }
1628
1629 // Top up key pool, to generate scriptPubKeys
1630 if (!TopUpWithDB(batch)) {
1631 throw std::runtime_error("Could not top up scriptPubKeys");
1632 }
1633}
1634
1635bool DescriptorScriptPubKeyMan::CanUpdateToWalletDescriptor(const WalletDescriptor& descriptor, std::string& error)
1636{

Callers 2

CreateFromImportMethod · 0.80
CreateFromMigrationMethod · 0.80

Calls 1

GetPubKeyMethod · 0.45

Tested by

no test coverage detected