Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for listsinceblock not filtering conflicted transactions #10470

Conversation

mchrostowski
Copy link
Contributor

@mchrostowski mchrostowski commented May 27, 2017

Fix for issue #8752 which, if merged, replaces PR #8757

I prepped functional/listsinceblock.py for additional tests.
Wrote a test for the above issue.
Made a fix to rpcwallet.cpp:listsinceblock(...).

The fix takes advantage of CMerkleTx::GetDepthInMainChain() returning a negative value for conflicted transactions. The negative value represents the depth of the transaction with which it is conflicted. Taking abs(...) of this lets us use the same logic for filtering un-conflicted transactions to filter the conflicted ones.

Tests that conflicted transactions are not returned by calls
to listsinceblock that filter out the confirmed transaction
with which they are conflicted.
listsinceblock now checks that returned transactions are not
conflicting with any transactions that are filtered out by
the given blockhash.
@RHavar
Copy link
Contributor

RHavar commented Jun 22, 2017

ACK - I can reproduce the problem, and this does fix it =)

@jonasschnelli
Copy link
Contributor

utACK df09c3a

@jonasschnelli
Copy link
Contributor

Needs rebase though now.

@TheBlueMatt
Copy link
Contributor

@mchrostowski any plans to rebase this?

@fanquake fanquake closed this May 17, 2018
meshcollider added a commit that referenced this pull request Nov 5, 2019
436ad43 Fix issue with conflicted mempool tx in listsinceblock (Adam Jonas)

Pull request description:

  Closes #8752 by bringing back abandoned #10470.

  This now checks that returned transactions are not conflicting with any transactions that are filtered out by the given blockhash and add a functional test to prevent this in the future.

  For more context, #8757 was closed in favor of #10470.

ACKs for top commit:
  instagibbs:
    utACK 436ad43
  kallewoof:
    utACK 436ad43
  jonatack:
    I'm not qualifed to give an ACK here but 436ad43 appears reasonable. Built/ran tests/verified that this test fails without the change in rpcwallet.cpp:

Tree-SHA512: 63d75cd3d3f19fc84dc38899b200c96179b82b24db263cd0116ee5b715265be647157855c2e35912d2fbc49c7b37db9375d6aab0ac672f0f09bece8431de5ea9
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Nov 7, 2019
…eblock

436ad43 Fix issue with conflicted mempool tx in listsinceblock (Adam Jonas)

Pull request description:

  Closes bitcoin#8752 by bringing back abandoned bitcoin#10470.

  This now checks that returned transactions are not conflicting with any transactions that are filtered out by the given blockhash and add a functional test to prevent this in the future.

  For more context, bitcoin#8757 was closed in favor of bitcoin#10470.

ACKs for top commit:
  instagibbs:
    utACK bitcoin@436ad43
  kallewoof:
    utACK 436ad43
  jonatack:
    I'm not qualifed to give an ACK here but 436ad43 appears reasonable. Built/ran tests/verified that this test fails without the change in rpcwallet.cpp:

Tree-SHA512: 63d75cd3d3f19fc84dc38899b200c96179b82b24db263cd0116ee5b715265be647157855c2e35912d2fbc49c7b37db9375d6aab0ac672f0f09bece8431de5ea9
sidhujag pushed a commit to syscoin-core/syscoin that referenced this pull request Nov 10, 2020
…eblock

436ad43 Fix issue with conflicted mempool tx in listsinceblock (Adam Jonas)

Pull request description:

  Closes bitcoin#8752 by bringing back abandoned bitcoin#10470.

  This now checks that returned transactions are not conflicting with any transactions that are filtered out by the given blockhash and add a functional test to prevent this in the future.

  For more context, bitcoin#8757 was closed in favor of bitcoin#10470.

ACKs for top commit:
  instagibbs:
    utACK bitcoin@436ad43
  kallewoof:
    utACK 436ad43
  jonatack:
    I'm not qualifed to give an ACK here but 436ad43 appears reasonable. Built/ran tests/verified that this test fails without the change in rpcwallet.cpp:

Tree-SHA512: 63d75cd3d3f19fc84dc38899b200c96179b82b24db263cd0116ee5b715265be647157855c2e35912d2fbc49c7b37db9375d6aab0ac672f0f09bece8431de5ea9
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 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.

None yet

5 participants