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
rpc: Extract scriptPubKey on getreceivedbyaddress #16655
Conversation
What is this? refactoring or a bugfix? |
bugfix, the expected result from getreceivedbyaddress is different from getreceivedbylabel when the transaction scriptPubKey contains shifted opcodes |
Would be nice to include a test that fails before the changes and passes after |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
@MarcoFalke |
This will make P2PK outputs show up under the address for the corresponding P2PKH. Is that desirable? |
@sipa it is under |
Ah, for consistency that does make sense. |
feature_block.py works for me (patch included/excluded), the error is probably due to a timeout on trevis side Edit: works on appveyor too |
], | ||
"hex": "02000000000100ca9a3b00000000232102352974bf0da1e6c4652888f014446572669cf7f9fd54d2c3b3d26ef60f15bd4cac00000000" | ||
} | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is no need to copy paste the full output of the command
Concept NACK: p2pk aren't addresses, so this is actually introducing a bug. Labels are [at least effectively] assigned for both p2pk and p2pkh, which is why there is a discrepancy. |
Concept NACK for same reason than @luke-jr and same reason as #16725 . I lost so much time explaining why the genesis transaction output should not appear as an address in block explorers, only to get replied "but why bitcoin core does it?". This in general cause lot's of confusion to new developers and end up in numerous bugs which only happen in production when a malicious actor sends a payment as P2PK to the the same pubkey as the expected P2PKH. This is worse than a bug, this is a virus, because it spreads a bad practice in the mind of new developers. Not only this, but P2PK is deprecated, so it does not make sense to add support to something that anyway should not be used anymore. |
@konez2k thanks for contributing! I think consistency is really valuable, but in this case as the others above have pointed out, it is probably consistency in the wrong direction. Unless anyone else is in support of this, I think its better to close it, but I hope that does not discourage you from contributing more in the future 😄 |
Update rpc method
getreceivedbyaddress
to extract the correct scriptPubKey when shifted with opcodes (f.e. OP_CHECKSIG).getreceivedbylabel is already implemented in the same way.