mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Add PubKeyDestination for P2PK scripts
P2PK scripts are not PKHash destinations, they should have their own type. This also results in no longer showing a p2pkh address for p2pk outputs. However for backwards compatibility, ListCoinst will still do this conversion.
This commit is contained in:
@@ -172,6 +172,15 @@ CTxDestination ConsumeTxDestination(FuzzedDataProvider& fuzzed_data_provider) no
|
||||
[&] {
|
||||
tx_destination = CNoDestination{};
|
||||
},
|
||||
[&] {
|
||||
bool compressed = fuzzed_data_provider.ConsumeBool();
|
||||
CPubKey pk{ConstructPubKeyBytes(
|
||||
fuzzed_data_provider,
|
||||
ConsumeFixedLengthByteVector(fuzzed_data_provider, (compressed ? CPubKey::COMPRESSED_SIZE : CPubKey::SIZE)),
|
||||
compressed
|
||||
)};
|
||||
tx_destination = PubKeyDestination{pk};
|
||||
},
|
||||
[&] {
|
||||
tx_destination = PKHash{ConsumeUInt160(fuzzed_data_provider)};
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user