Skip to content

Conversation

@sipa
Copy link
Member

@sipa sipa commented Nov 13, 2012

These flags select features to be enabled/disabled during script
evaluation/checking, instead of several booleans passed along.
Currently these flags are defined:

  • SCRIPT_VERIFY_P2SH: enable BIP16-style subscript evaluation
  • SCRIPT_VERIFY_STRICTENC: enforce strict adherence to pubkey/sig encoding standards.

No semantic changes.

@jgarzik
Copy link
Contributor

jgarzik commented Nov 14, 2012

99% ACK

Prefer unsigned for flags-type variables...

@luke-jr
Copy link
Member

luke-jr commented Nov 14, 2012

Some reason not to use an enum type? :p

@sipa
Copy link
Member Author

sipa commented Nov 14, 2012

You cannot OR enum type elements together without them degenerating to an integer type, I think.

@luke-jr
Copy link
Member

luke-jr commented Nov 14, 2012

GCC doesn't warn about it, at least.

@jgarzik
Copy link
Contributor

jgarzik commented Nov 14, 2012

@sipa is correct. Storage class for enum is 'int', unless greater size is needed (int -> unsigned int -> long -> unsigned long -> etc., IIRC)

@laanwj
Copy link
Member

laanwj commented Nov 14, 2012

Indeed, you can define flags using an enum, but you can't use the enum as parameter when you want to be able to specify multiple flags as it's no longer an enumeration. I believe Qt has a 'typesafe flags' type but that doesn't help us here :) I do think defining the flag values using an enum has a nicer syntax than a list of const XXX.

And I agree with @jgarzik that it's better to have anything that you manipulate bitwise be unsigned. It steers clear of crazy undefined areas of C++, such as overflows flipping the sign bit.

@jgarzik
Copy link
Contributor

jgarzik commented Nov 14, 2012

This might work, too, IIRC:

enum my_foo_bits {
    FLAG_FOO = (1U << 0),
    FLAG_BAR = (1U << 1),
};

@Diapolo
Copy link

Diapolo commented Nov 14, 2012

@laanwj Nice I observed the same problem with the client interface pull we are working on ^^. We should then change to unsigned int there, too, right?

@luke-jr: GCC warns about OR 2 enum flags, when the function parameter is expected to be an enum ;), tried it.

@laanwj
Copy link
Member

laanwj commented Nov 14, 2012

Yes, it applies there too :)

@sipa
Copy link
Member Author

sipa commented Nov 14, 2012

Updated.

@gavinandresen
Copy link
Contributor

ACK

1 similar comment
@laanwj
Copy link
Member

laanwj commented Nov 15, 2012

ACK

@Diapolo
Copy link

Diapolo commented Nov 15, 2012

Comments from @jgarzik are not in, so it would be nice if @sipa could update to these last 4 suggestions before this should get merged IMO.

These flags select features to be enabled/disabled during script
evaluation/checking, instead of several booleans passed along.
Currently these flags are defined:
* SCRIPT_VERIFY_P2SH: enable BIP16-style subscript evaluation
* SCRIPT_VERIFY_STRICTENC: enforce strict adherence to pubkey/sig encoding standards.
@sipa
Copy link
Member Author

sipa commented Nov 15, 2012

Updated.

jgarzik pushed a commit that referenced this pull request Nov 15, 2012
Introduce script verification flags
@jgarzik jgarzik merged commit 3b9f029 into bitcoin:master Nov 15, 2012
laudney pushed a commit to reddcoin-project/reddcoin-3.10 that referenced this pull request Mar 19, 2014
Introduce script verification flags
HashUnlimited pushed a commit to chaincoin/chaincoin that referenced this pull request Mar 21, 2018
…itcoin#2008)

* Check if in masternode mode first and only then do the job (or not)

* address review comment

Conflicts:
	src/privatesend-client.cpp
	src/privatesend-server.cpp
KolbyML pushed a commit to KolbyML/bitcoin that referenced this pull request Dec 5, 2020
…elded coin control

563663b [BUG] label of coin type in send widget after shielded coin control (random-zebra)

Pull request description:

  Simple visual bugfix.
  `labelAmountRemaining` not being updated with the proper coin-type "shielded", after selecting notes in coin control.

  Closes bitcoin#2002

ACKs for top commit:
  furszy:
    good, utACK 563663b

Tree-SHA512: 942a171bc7de87a73cf8f8fcc1b2e6077d93a668e2c95da3ead292862bdc37decde192fa6f623938de88940c69b644837a95a5dd4084674f6371014d4eb7e17d
@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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants