Empact
commented at 10:25 PM on January 2, 2019:
member
Also removed WithOrVersion as this was the only use and shows the function's pitfalls. The other uses of OverrideStream are direct.
NicolasDorier
commented at 2:14 PM on January 3, 2019:
contributor
I don't remember this function at all, ACK to remove it.
Only point to consider: test_big_witness_transaction was quite a slow test... which you are now executing twice. Fine for me though, just mentioning it.
test: Correct ineffectual WithOrVersion from transactions_tests
WithOrVersion uses | to combine the versions, and | with 0 is a no-op.
Instead I run it with PROTOCOL_VERSION and 0 separately, as the original
code only tested PROTOCOL_VERSION but apparently only intended to test
version 0.
Introduced in ab48c5e72156b34300db4a6521cb3c9969be3937
Last updated 81e3228fcb33e8ed32d8b9fbe917444ba080073a
75778a0724
Empact force-pushed on Jan 3, 2019
Empact
commented at 5:14 PM on January 3, 2019:
member
Dropped the 0-version test as there is no version-specific behavior in transaction serialization, and if there were, does not seem this would be the place to test it.
Maybe you can weigh in on: is it necessary to do this serialization round-trip at all? Could instantiate the tx from the mtx directly.
NicolasDorier
commented at 5:38 AM on January 4, 2019:
contributor
I speculate that the intention of the WithOrVersion was to add segwit support to the serialization, because before PROTOCOL_VERSION was setting the flag fAllowWitness to false. Now, PROTOCOL_VERSION implies we support segwit serialization, so it became useless.
The roundtrip itself is just used to convert a CMutableTransaction into a CTransaction.
It is safe to drop the 0-version test.
NicolasDorier
commented at 5:39 AM on January 4, 2019:
contributor
ACK
MarcoFalke
commented at 11:15 AM on January 4, 2019:
member
PROTOCOL_VERSION was setting the flag fAllowWitness to false
Are you sure on that? To me it seems that fAllowWitness is always true unless SERIALIZE_TRANSACTION_NO_WITNESS is flagged in the version.
utACK75778a0724b73a0cecd99bd2e1c49fbfdb90e194
sipa
commented at 11:16 AM on January 4, 2019:
member
utACK
MarcoFalke referenced this in commit 5b6b371c77 on Jan 4, 2019
MarcoFalke merged this on Jan 4, 2019
MarcoFalke closed this on Jan 4, 2019
NicolasDorier
commented at 1:57 PM on January 4, 2019:
contributor
@MarcoFalke yes, that's why I said was. Before we had PROTOCOL_VERSION + a flag to add witness.
Then it was refactored for having witness in PROTOCOL_VERSION + a flag to disable witness. Unsure if it was before the merge or after the merge that this was refactored, but I am now almost sure it was the initial reason behind this weird code.
MarcoFalke
commented at 4:02 PM on January 4, 2019:
member
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2026-04-30 00:15 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me