mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 06:52:36 +01:00
Merge bitcoin/bitcoin#25790: wallet: improve {LoadActive,Deactivate}ScriptPubKeyMan
log
b5a762a353
wallet: improve `{LoadActive,Deactivate}ScriptPubKeyMan` log (w0xlt) Pull request description: This PR includes the output type description in the log. It currently shows the enum position, which is only useful if the reader knows the code. Master: ``` Setting spkMan to active: id = 9f..04, type = 3, internal = 0 Setting spkMan to active: id = 3d..21, type = 2, internal = 0 Setting spkMan to active: id = 69..d4, type = 0, internal = 1 Setting spkMan to active: id = 97..ea, type = 1, internal = 1 ``` PR: ``` Setting spkMan to active: id = 6a..4f, type = bech32m, internal = false Setting spkMan to active: id = 83..dc, type = legacy, internal = true Setting spkMan to active: id = 7e..5d, type = p2sh-segwit, internal = true Setting spkMan to active: id = bd..d2, type = bech32, internal = true Setting spkMan to active: id = 13...7c, type = bech32m, internal = true ``` ACKs for top commit: S3RK: Code review ACKb5a762a353
achow101: ACKb5a762a353
theStack: Code-review ACKb5a762a353
Tree-SHA512: 5a79706d5452e523b0456fb8435545c6c8e550b6722c0d7966af79011275a97ed97cab297562e031d601aa855118082c5b770af118783b1faaaec0cba9f9ee6a
This commit is contained in:
commit
a478c5350a
1 changed files with 2 additions and 2 deletions
|
@ -3484,7 +3484,7 @@ void CWallet::LoadActiveScriptPubKeyMan(uint256 id, OutputType type, bool intern
|
|||
// Legacy wallets have only one ScriptPubKeyManager and it's active for all output and change types.
|
||||
Assert(IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS));
|
||||
|
||||
WalletLogPrintf("Setting spkMan to active: id = %s, type = %d, internal = %d\n", id.ToString(), static_cast<int>(type), static_cast<int>(internal));
|
||||
WalletLogPrintf("Setting spkMan to active: id = %s, type = %s, internal = %s\n", id.ToString(), FormatOutputType(type), internal ? "true" : "false");
|
||||
auto& spk_mans = internal ? m_internal_spk_managers : m_external_spk_managers;
|
||||
auto& spk_mans_other = internal ? m_external_spk_managers : m_internal_spk_managers;
|
||||
auto spk_man = m_spk_managers.at(id).get();
|
||||
|
@ -3502,7 +3502,7 @@ void CWallet::DeactivateScriptPubKeyMan(uint256 id, OutputType type, bool intern
|
|||
{
|
||||
auto spk_man = GetScriptPubKeyMan(type, internal);
|
||||
if (spk_man != nullptr && spk_man->GetID() == id) {
|
||||
WalletLogPrintf("Deactivate spkMan: id = %s, type = %d, internal = %d\n", id.ToString(), static_cast<int>(type), static_cast<int>(internal));
|
||||
WalletLogPrintf("Deactivate spkMan: id = %s, type = %s, internal = %s\n", id.ToString(), FormatOutputType(type), internal ? "true" : "false");
|
||||
WalletBatch batch(GetDatabase());
|
||||
if (!batch.EraseActiveScriptPubKeyMan(static_cast<uint8_t>(type), internal)) {
|
||||
throw std::runtime_error(std::string(__func__) + ": erasing active ScriptPubKeyMan id failed");
|
||||
|
|
Loading…
Add table
Reference in a new issue