mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 06:43:45 +01:00
Merge #12461: scripted-diff: Rename key size consts to be relative to their class
0580f86bb4Fixup whitespace (Ben Woosley)47101bbb27scripted-diff: Rename CPubKey and CKey::*_KEY_SIZE and COMPRESSED_*_KEY_SIZE (Ben Woosley) Pull request description: ~~And introduce CPubKeySig to host code relative to key sigs.~~ ACKs for top commit: meshcollider: utACK0580f86bb4Tree-SHA512: 29aa0be54912358b138e391b9db78639786f56580493e590ec9f773c0e1b421740133d05a79be247c7ee57e71c9c9e41b9cb54088cb3c0e3f813f74f0895287b
This commit is contained in:
@@ -44,12 +44,12 @@ const char* GetTxnOutputType(txnouttype t)
|
||||
|
||||
static bool MatchPayToPubkey(const CScript& script, valtype& pubkey)
|
||||
{
|
||||
if (script.size() == CPubKey::PUBLIC_KEY_SIZE + 2 && script[0] == CPubKey::PUBLIC_KEY_SIZE && script.back() == OP_CHECKSIG) {
|
||||
pubkey = valtype(script.begin() + 1, script.begin() + CPubKey::PUBLIC_KEY_SIZE + 1);
|
||||
if (script.size() == CPubKey::SIZE + 2 && script[0] == CPubKey::SIZE && script.back() == OP_CHECKSIG) {
|
||||
pubkey = valtype(script.begin() + 1, script.begin() + CPubKey::SIZE + 1);
|
||||
return CPubKey::ValidSize(pubkey);
|
||||
}
|
||||
if (script.size() == CPubKey::COMPRESSED_PUBLIC_KEY_SIZE + 2 && script[0] == CPubKey::COMPRESSED_PUBLIC_KEY_SIZE && script.back() == OP_CHECKSIG) {
|
||||
pubkey = valtype(script.begin() + 1, script.begin() + CPubKey::COMPRESSED_PUBLIC_KEY_SIZE + 1);
|
||||
if (script.size() == CPubKey::COMPRESSED_SIZE + 2 && script[0] == CPubKey::COMPRESSED_SIZE && script.back() == OP_CHECKSIG) {
|
||||
pubkey = valtype(script.begin() + 1, script.begin() + CPubKey::COMPRESSED_SIZE + 1);
|
||||
return CPubKey::ValidSize(pubkey);
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user