Skip to content

Conversation

@gubatron
Copy link
Contributor

@gubatron gubatron commented Feb 19, 2017

The string parameter is used only for logging.

The only place where the string form of the hash isn't recalculated is at src/rpc/mining.cpp where it's obtained from the arguments, however, in this case the uint256 hash is then parsed from the given string.

In every other use of the function, the string representation is always calculated from the uint256 hash object (either with ToString() or with GetHash()), so no real benefit on having this redundant parameter.

This also makes the API more consistent with other methods that only receive the uint256 hash parameter.

Copy link
Contributor

@jonasschnelli jonasschnelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Thanks.
utACK 8e88a445dc9de71657282a461cb6b679c9079ebd

@paveljanik
Copy link
Contributor

ACK 8e88a44

@maflcko
Copy link
Member

maflcko commented Feb 20, 2017 via email

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps while you're at it you could make this const uint256& hash?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done deal, thanks.

(squashed and rebased)

src/txmempool.h Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The redundant parameter is not removed, as mentioned in the commit message.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can run make check locally as a quick sanity check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, something got screwed with the rebase, re-uploaded now. Thanks.

(Also made the `const uint256 hash` parameter a `const uint256& hash` as suggested by @sdaftuar)
@paveljanik
Copy link
Contributor

ACK eaea2bb

@maflcko
Copy link
Member

maflcko commented Feb 22, 2017

utACK eaea2bb

@laanwj laanwj merged commit eaea2bb into bitcoin:master Feb 22, 2017
laanwj added a commit that referenced this pull request Feb 22, 2017
…action

eaea2bb Removed redundant parameter from mempool.PrioritiseTransaction (gubatron)
@gubatron gubatron deleted the refactor-mempool-prioritisetx branch February 23, 2017 05:36
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jan 3, 2019
…seTransaction

eaea2bb Removed redundant parameter from mempool.PrioritiseTransaction (gubatron)
UdjinM6 pushed a commit to dashpay/dash that referenced this pull request Jan 7, 2019
* Merge bitcoin#9815: Trivial: use EXIT_ codes instead of magic numbers

a87d02a use EXIT_ codes instead of magic numbers (Marko Bencun)

* Merge bitcoin#9801: Removed redundant parameter from mempool.PrioritiseTransaction

eaea2bb Removed redundant parameter from mempool.PrioritiseTransaction (gubatron)

* remove extra parameter (see 3a3745bb) in dash specific code

* Merge bitcoin#9819: Remove harmless read of unusued priority estimates

bc8fd12 Remove harmless read of unusued priority estimates (Alex Morcos)

* Merge bitcoin#9766: Add --exclude option to rpc-tests.py

c578408 Add exclude option to rpc-tests.py (John Newbery)

* Merge bitcoin#9577: Fix docstrings in qa tests

3f95a80 Fix docstrings in qa tests (John Newbery)

* Merge bitcoin#9823: qa: Set correct path for binaries in rpc tests

3333ad0 qa: Set correct path for binaries in rpc tests (MarcoFalke)

* Merge bitcoin#9833: Trivial: fix comments referencing AppInit2

ef9f495 Trivial: fix comments referencing AppInit2 (Marko Bencun)

* Merge bitcoin#9612: [trivial] Rephrase the definition of difficulty.

dc222f8 Trivial: Rephrase the definition of difficulty in the code. (Karl-Johan Alm)

* Merge bitcoin#9847: Extra test vector for BIP32

30aedcb BIP32 extra test vector (Pieter Wuille)

* Merge bitcoin#9839: [qa] Make import-rescan.py watchonly check reliable

864890a [qa] Make import-rescan.py watchonly check reliable (Russell Yanofsky)

Tree-SHA512: ea0e2b1d4fc8f35174c3d575fb751b428daf6ad3aa944fad4e3ddcc9195e4f17051473acabc54203b1d27cca64cf911b737ab92e986c40ef384410652e2dbea1

* Change back file params
@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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants