Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Dec 14, 2015

Conversation

accraze
Copy link
Contributor

@accraze accraze commented Dec 12, 2015

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

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 bitcoin#6142
@@ -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[0] != OP_RETURN)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of checking txout.scriptPubKey[0] you should probably use CScript::IsUnspendable().

@jonasschnelli
Copy link
Contributor

Concept ACK.

@accraze
Copy link
Contributor Author

accraze commented Dec 12, 2015

updated code to use CScript::IsUnspendable()

@sipa
Copy link
Member

sipa commented Dec 12, 2015

utACK

1 similar comment
@jonasschnelli
Copy link
Contributor

utACK

@laanwj laanwj merged commit d812daf into bitcoin:master Dec 14, 2015
laanwj added a commit that referenced this pull request Dec 14, 2015
d812daf fix logic for error log (accraze)
c611acc wallet: check if tx scriptPubKey is unspendable (accraze)
b6915b8 checks for null data transaction before debug.log (accraze)
laanwj pushed a commit that referenced this pull request Dec 14, 2015
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: b6915b8 c611acc d812daf
luke-jr pushed a commit to luke-jr/bitcoin that referenced this pull request Dec 28, 2015
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 bitcoin#6142

Github-Pull: bitcoin#7200
Rebased-From: b6915b8
luke-jr pushed a commit to luke-jr/bitcoin that referenced this pull request Dec 28, 2015
luke-jr pushed a commit to luke-jr/bitcoin that referenced this pull request Dec 28, 2015
Github-Pull: bitcoin#7200
Rebased-From: d812daf
luke-jr pushed a commit to luke-jr/bitcoin that referenced this pull request Dec 28, 2015
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 bitcoin#6142

Github-Pull: bitcoin#7200
Rebased-From: b6915b8
luke-jr pushed a commit to luke-jr/bitcoin that referenced this pull request Dec 28, 2015
luke-jr pushed a commit to luke-jr/bitcoin that referenced this pull request Dec 28, 2015
Github-Pull: bitcoin#7200
Rebased-From: d812daf
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Null data transactions are treated as unknown transaction in log messages
4 participants