HomePhabricator

[txpackages] add canonical way to get hash of package

Description

[txpackages] add canonical way to get hash of package

Summary:
Partial backport of core#28970:
https://github.com/bitcoin/bitcoin/pull/28970/commits/092c978a42e8f4a02291b994713505ba8aac8b28

TxId sorting is correct, see D1527 (and comment in the test).
Since we use txid instead of wtxid + correct endianness in the comparison, the test is greatly simplified.

Note that we miss some backports that would allow to remove the type and version from the hasher/datastream, but there is no difference in behavior.

Depends on D16490.

Test Plan:

ninja check-bitcoin-txpackage_tests

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D16491

Details

Provenance
glozow <gloriajzhao@gmail.com>Authored on Apr 16 2024, 10:58
FabienCommitted on Jul 18 2024, 09:05
FabienPushed on Jul 18 2024, 09:05
Reviewer
Restricted Project
Differential Revision
D16491: [txpackages] add canonical way to get hash of package
Parents
rABC48cb63e4a344: rpc: allow submitpackage to be called outside of regtest
Branches
Unknown
Tags
Unknown