pull/816/head
David Burkett 3 years ago committed by Loshan T
parent 149b4e5da5
commit 6b88691d7c

@ -49,8 +49,12 @@ WalletTxOut MakeWalletTxOut(CWallet& wallet,
if (output.IsMWEB()) { if (output.IsMWEB()) {
mw::Coin coin; mw::Coin coin;
if (wallet.GetCoin(output.ToMWEB(), coin)) { if (wallet.GetCoin(output.ToMWEB(), coin) && coin.IsMine()) {
result.address = wallet.GetMWWallet()->GetStealthAddress(coin.address_index); StealthAddress addr;
if (wallet.GetMWWallet()->GetStealthAddress(coin, addr)) {
result.address = addr;
}
result.nValue = coin.amount; result.nValue = coin.amount;
} }
} else { } else {
@ -538,9 +542,9 @@ public:
RemoveWallet(m_wallet, false /* load_on_start */); RemoveWallet(m_wallet, false /* load_on_start */);
} }
bool isLegacy() override { return m_wallet->IsLegacy(); } bool isLegacy() override { return m_wallet->IsLegacy(); }
StealthAddress getPeginAddress() override bool getPeginAddress(StealthAddress& pegin_address) override
{ {
return m_wallet->GetMWWallet()->GetStealthAddress(mw::PEGIN_INDEX); return m_wallet->GetMWWallet()->GetStealthAddress(mw::PEGIN_INDEX, pegin_address);
} }
std::unique_ptr<Handler> handleUnload(UnloadFn fn) override std::unique_ptr<Handler> handleUnload(UnloadFn fn) override
{ {

@ -283,8 +283,8 @@ public:
//! Return whether is a legacy wallet //! Return whether is a legacy wallet
virtual bool isLegacy() = 0; virtual bool isLegacy() = 0;
// Get MWEB wallet. // Get pegin address from MWEB wallet.
virtual StealthAddress getPeginAddress() = 0; virtual bool getPeginAddress(StealthAddress& pegin_address) = 0;
//! Register handler for unload message. //! Register handler for unload message.
using UnloadFn = std::function<void()>; using UnloadFn = std::function<void()>;

Loading…
Cancel
Save