8000 [Upstream] [Wallet] Various transaction handling improvements (Part 1) by lyricidal · Pull Request #331 · PRCYCoin/PRCYCoin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Upstream] [Wallet] Various transaction handling improvements (Part 1) #331

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

Merged
merged 4 commits into from
Jan 11, 2023

Conversation

lyricidal
Copy link

Commits details

from PIVX-Project/PIVX#970
Will be split into 2 parts
This part adds the initial commits + 1 other that can be safely de-coupled
Part 2 will add the MarkConflicted/AbandonTransaction-related commits/functions/fixes

Backport of bitcoin/bitcoin#6550

Assume that when a wallet transaction has a valid block hash and
transaction position
in it, the transaction is actually there. We're already trusting wallet
data in a
much more fundamental way anyway.

To prevent backward compatibility issues, a new record is used for
storing the
block locator in the wallet. Old wallets will see a wallet file
synchronized up
to the genesis block, and rescan automatically.
Backport of bitcoin/bitcoin#6508

This switches the Merkle tree logic for blocks to one that runs in constant (small) space. The old code is moved to tests, and a new test is added that for various combinations of block sizes, transaction positions to compute a branch for, and mutations:
 * Verifies that the old code and new code agree for the Merkle root.
 * Verifies that the old code and new code agree for the Merkle branch.
 * Verifies that the computed Merkle branch is valid.
 * Verifies that mutations don't change the Merkle root.
 * Verifies that mutations are correctly detected.
During startup, when adding pending wallet transactions, which spend outputs of other pending wallet transactions, back to the memory pool, and when they are added out of order, it appears as if they are orphans with missing inputs.

Those transactions are then rejected and flagged as conflicting" (= not in the memory pool, not in the block chain).

To prevent this, transactions are explicitly sorted.
@lyricidal lyricidal added enhancement New feature or request Upstream Upstream backports/fixes labels Jan 11, 2023
@lyricidal lyricidal merged commit 531c616 into develop Jan 11, 2023
@lyricidal lyricidal deleted the upstream-wallet_improvements-pr970_pt.1 branch January 11, 2023 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Upstream Upstream backports/fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0