Skip to content

Conversation

@sdaftuar
Copy link
Member

Previously we used the CInv that would be sent to the peer announcing the transaction as the key, but using the txid instead allows us to decouple the p2p layer from the application logic.

This is a minor preparatory commit for segwit, in which the inv-type will no longer be the same for all transaction requests.

Previously we used the CInv that would be sent to the peer announcing the
transaction as the key, but using the txid instead allows us to decouple the
p2p layer from the application logic (which relies on this map to avoid
duplicate tx requests).
@dcousens
Copy link
Contributor

utACK 7e91f63

@theuni
Copy link
Member

theuni commented Apr 12, 2016

utACK 7e91f63

@sipa
Copy link
Member

sipa commented Apr 12, 2016

utACK 7e91f63

1 similar comment
@jonasschnelli
Copy link
Contributor

utACK 7e91f63

@maflcko
Copy link
Member

maflcko commented Apr 13, 2016

Should be tagged with "Backport 0.12.2" if this is meant for segwit.

@sdaftuar
Copy link
Member Author

@MarcoFalke Agreed, thanks for pointing that out.

@laanwj
Copy link
Member

laanwj commented Apr 14, 2016

Makes sense to me. mapAlreadyAskedFor, although the generic name could mislead, is only used for transactions, not blocks, so there is no reason to have anything but the txid in the key at all.
utACK 7e91f63

@laanwj laanwj merged commit 7e91f63 into bitcoin:master Apr 14, 2016
laanwj added a commit that referenced this pull request Apr 14, 2016
7e91f63 Use txid as key in mapAlreadyAskedFor (Suhas Daftuar)
maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request Apr 27, 2016
Previously we used the CInv that would be sent to the peer announcing the
transaction as the key, but using the txid instead allows us to decouple the
p2p layer from the application logic (which relies on this map to avoid
duplicate tx requests).

Github-Pull: bitcoin#7862
Rebased-From: 7e91f63
@maflcko
Copy link
Member

maflcko commented Jun 9, 2016

Backported as part of #7938. Removing label 'Needs backport'.

thokon00 pushed a commit to faircoin/faircoin that referenced this pull request Jun 28, 2016
Previously we used the CInv that would be sent to the peer announcing the
transaction as the key, but using the txid instead allows us to decouple the
p2p layer from the application logic (which relies on this map to avoid
duplicate tx requests).

Github-Pull: bitcoin#7862
Rebased-From: 7e91f63
zkbot added a commit to zcash/zcash that referenced this pull request Aug 4, 2021
ZIP 239 preparations 1

This is the first of several backports to prepare for ZIP 239. The primary
change is altering `mapRelay` to store `CTransaction`s, which we need
because ZIP 239 requires changing `Inv` messages based on transaction
versions. The other changes are mainly for conflict removal but are also
independently useful.

Backports the following upstream PRs:
- bitcoin/bitcoin#6889
- bitcoin/bitcoin#7125
- bitcoin/bitcoin#7862
- bitcoin/bitcoin#7877
zkbot added a commit to zcash/zcash that referenced this pull request Aug 5, 2021
ZIP 239 preparations 1

This is the first of several backports to prepare for ZIP 239. The primary
change is altering `mapRelay` to store `CTransaction`s, which we need
because ZIP 239 requires changing `Inv` messages based on transaction
versions. The other changes are mainly for conflict removal but are also
independently useful.

Backports the following upstream PRs:
- bitcoin/bitcoin#6889
- bitcoin/bitcoin#7125
- bitcoin/bitcoin#7862
- bitcoin/bitcoin#7877
zkbot added a commit to zcash/zcash that referenced this pull request Aug 10, 2021
ZIP 239 preparations 1

This is the first of several backports to prepare for ZIP 239. The primary
change is altering `mapRelay` to store `CTransaction`s, which we need
because ZIP 239 requires changing `Inv` messages based on transaction
versions. The other changes are mainly for conflict removal but are also
independently useful.

Backports the following upstream PRs:
- bitcoin/bitcoin#6889
- bitcoin/bitcoin#7125
- bitcoin/bitcoin#7862
- bitcoin/bitcoin#7877
@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.

7 participants