File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -1676,7 +1676,7 @@ util::Result<CTxDestination> DescriptorScriptPubKeyMan::GetNewDestination(const
1676
1676
std::optional<OutputType> desc_addr_type = m_wallet_descriptor.descriptor ->GetOutputType ();
1677
1677
assert (desc_addr_type);
1678
1678
if (type != *desc_addr_type) {
1679
- throw std::runtime_error (std::string (__func__) + " : Types are inconsistent" );
1679
+ throw std::runtime_error (std::string (__func__) + " : Types are inconsistent. Stored type does not match type of newly generated address " );
1680
1680
}
1681
1681
1682
1682
TopUp ();
@@ -1694,11 +1694,8 @@ util::Result<CTxDestination> DescriptorScriptPubKeyMan::GetNewDestination(const
1694
1694
}
1695
1695
1696
1696
CTxDestination dest;
1697
- std::optional<OutputType> out_script_type = m_wallet_descriptor.descriptor ->GetOutputType ();
1698
- if (out_script_type && out_script_type == type) {
1699
- ExtractDestination (scripts_temp[0 ], dest);
1700
- } else {
1701
- throw std::runtime_error (std::string (__func__) + " : Types are inconsistent. Stored type does not match type of newly generated address" );
1697
+ if (!ExtractDestination (scripts_temp[0 ], dest)) {
1698
+ return util::Error{_ (" Error: Cannot extract destination from the generated scriptpubkey" )}; // shouldn't happen
1702
1699
}
1703
1700
m_wallet_descriptor.next_index ++;
1704
1701
WalletBatch (m_storage.GetDatabase ()).WriteDescriptor (GetID (), m_wallet_descriptor);
You can’t perform that action at this time.
0 commit comments