Checks for null data transaction before issuing error to debug.log

CWalletTx::GetAmounts could not find output address for null data transactions, thus issuing an error in debug.log. This change checks to see if the transaction is OP_RETURN before issuing error.

resolves #6142

Github-Pull: #7200
Rebased-From: b6915b8239 c611acc38a d812daf967
This commit is contained in:
accraze 2015-12-11 18:07:11 -08:00 committed by Wladimir J. van der Laan
parent f43c2f9a8a
commit 06c6a58463
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
1 changed files with 2 additions and 1 deletions

View File

@ -1034,7 +1034,8 @@ void CWalletTx::GetAmounts(list<COutputEntry>& listReceived,
// In either case, we need to get the destination address
CTxDestination address;
if (!ExtractDestination(txout.scriptPubKey, address))
if (!ExtractDestination(txout.scriptPubKey, address) && !txout.scriptPubKey.IsUnspendable())
{
LogPrintf("CWalletTx::GetAmounts: Unknown transaction type found, txid %s\n",
this->GetHash().ToString());