QT: Always return blinded address

This commit is contained in:
Gregory Sanders 2019-04-10 12:53:31 -04:00
parent dbac2afd0f
commit ab21387c8b
3 changed files with 9 additions and 1 deletions

View file

@ -192,6 +192,10 @@ public:
return result;
}
void learnRelatedScripts(const CPubKey& key, OutputType type) override { m_wallet.LearnRelatedScripts(key, type); }
CPubKey getBlindingPubKey(const CScript& script) override
{
return m_wallet.GetBlindingPubKey(script);
}
bool addDestData(const CTxDestination& dest, const std::string& key, const std::string& value) override
{
LOCK(m_wallet.cs_wallet);

View file

@ -111,6 +111,9 @@ public:
//! database can detect payments to newer address types.
virtual void learnRelatedScripts(const CPubKey& key, OutputType type) = 0;
//! Get blinding pubkey for script
virtual CPubKey getBlindingPubKey(const CScript& script) = 0;
//! Add dest data.
virtual bool addDestData(const CTxDestination& dest, const std::string& key, const std::string& value) = 0;

View file

@ -380,7 +380,8 @@ QString AddressTableModel::addRow(const QString &type, const QString &label, con
}
}
walletModel->wallet().learnRelatedScripts(newKey, address_type);
strAddress = EncodeDestination(GetDestinationForKey(newKey, address_type));
CPubKey blinding_pubkey = walletModel->wallet().getBlindingPubKey(GetScriptForDestination(GetDestinationForKey(newKey, address_type)));
strAddress = EncodeDestination(GetDestinationForKey(newKey, address_type, blinding_pubkey));
}
else
{