getreceivedbyaddress
to extract the correct scriptPubKey when shifted with opcodes (f.e. OP_CHECKSIG).
getreceivedbylabel is already implemented in the same way.
rpc: Extract scriptPubKey on getreceivedbyaddress #16655
pull konez2k wants to merge 5 commits into bitcoin:master from konez2k:rpcwallet_patch changing 3 files +51 −3-
konez2k commented at 2:16 pm on August 19, 2019: noneUpdate rpc method
-
RPC: Extract scriptPubKey on getreceivedbyaddress 5553f5a14e
-
fanquake added the label RPC/REST/ZMQ on Aug 19, 2019
-
MarcoFalke commented at 2:20 pm on August 19, 2019: memberWhat is this? refactoring or a bugfix?
-
konez2k commented at 2:21 pm on August 19, 2019: nonebugfix, the expected result from getreceivedbyaddress is different from getreceivedbylabel when the transaction scriptPubKey contains shifted opcodes
-
MarcoFalke commented at 2:23 pm on August 19, 2019: memberWould be nice to include a test that fails before the changes and passes after
-
DrahtBot commented at 3:08 pm on August 19, 2019: member
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Conflicts
No conflicts as of last run.
-
Test: Add RPC getreivedbyaddress functional test b70a54c3fa
-
Test: Remove getreceivedbyaddress unused imports 6af0709fd4
-
konez2k commented at 4:27 pm on August 19, 2019: none@MarcoFalke The issue is mainly with legacy addresses when sending a transaction using address pubkey
-
sipa commented at 4:44 pm on August 19, 2019: memberThis will make P2PK outputs show up under the address for the corresponding P2PKH. Is that desirable?
-
sipa commented at 5:02 pm on August 19, 2019: memberAh, for consistency that does make sense.
-
Add test to test_runner.py 7828f9b0ff
-
konez2k commented at 10:47 am on August 20, 2019: none
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
-
in test/functional/rpc_getreceivedbyaddress.py:54 in 7828f9b0ff outdated
49+ } 50+ } 51+ ], 52+ "hex": "02000000000100ca9a3b00000000232102352974bf0da1e6c4652888f014446572669cf7f9fd54d2c3b3d26ef60f15bd4cac00000000" 53+ } 54+ """
MarcoFalke commented at 12:02 pm on August 20, 2019:I think there is no need to copy paste the full output of the commandRemove bitcoin-tx output b45caf85c8fanquake renamed this:
RPC: Extract scriptPubKey on getreceivedbyaddress
rpc: Extract scriptPubKey on getreceivedbyaddress
on Aug 21, 2019luke-jr commented at 7:50 pm on August 23, 2019: memberConcept 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.
NicolasDorier commented at 1:51 pm on August 26, 2019: contributorConcept 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.
meshcollider commented at 3:36 am on September 10, 2019: contributor@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 😄meshcollider closed this on Sep 10, 2019
DrahtBot locked this on Dec 16, 2021
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-04 18:12 UTC
More mirrored repositories can be found on mirror.b10c.me