Skip to content

Conversation

@Fuzzbawls
Copy link
Collaborator

Backports the following PRs to the 4.2 branch:

#1746
#1735
#1767
#1769
#1781
#1780
#1775
#1783
#1750
#1785
#1796
#1776
#1791

jtimon and others added 26 commits August 12, 2020 16:13
coming from btc@eb1c2cd37f75cf4d0e85970932b9774b2d073225

Github-Pull: PIVX-Project#1735
Rebased-From: 6d2ea62
coming from btc@db994b2de93f52c9e7bed8529ca925de5064a46f

Github-Pull: PIVX-Project#1735
Rebased-From: 17e9b8e
>>> backports bitcoin/bitcoin@40e7b61

If number of conflict confirms cannot be determined, this means
that the block is still unknown or not yet part of the main chain,
for example during a reindex. Do nothing in that case,
instead of crash with an assertion.

Fixes bitcoin#7234.
Github-Pull: PIVX-Project#1767
Rebased-From: f90fa08
This value can be significantly higher if the users uses addnode

Github-Pull: PIVX-Project#1769
Rebased-From: 8d71860
>>> backports bitcoin/bitcoin@de9a1db

CWallet::MarkConflicted may acquire the cs_main lock after
CWalletDB::LoadWallet acquires the cs_wallet lock during wallet
initialization.
(CWalletDB::LoadWallet calls ReadKeyValue which calls
CWallet::LoadToWallet which calls CWallet::MarkConflicted). This is the
opposite order that cs_main and cs_wallet locks are acquired in the rest
of the code, and so leads to POTENTIAL DEADLOCK DETECTED errors if
bitcoin is built with -DDEBUG_LOCKORDER.

This commit changes CWallet::LoadWallet (which calls
CWalletDB::LoadWallet) to acquire both locks in the standard order. It
also fixes some tests that were acquiring wallet and main locks out of
order and failed with the new locking in CWallet::LoadWallet.

Error was reported by Luke Dashjr <[email protected]> in
https://botbot.me/freenode/bitcoin-core-dev/msg/90244330/
Github-Pull: PIVX-Project#1781
Rebased-From: 675ab11
…n disconnection

coming from btc@905bc68d05595f41cca36b3df83accd10c00cc48

Github-Pull: PIVX-Project#1780
Rebased-From: 0544cc6
cs_vSend is used for two purposes - to lock the datastructures used
to queue messages to place on the wire and to only call
SendMessages once at a time per-node. I believe SendMessages used
to access some of the vSendMsg stuff, but it doesn't anymore, so
these locks do not need to be on the same mutex, and also make
deadlocking much more likely.

Github-Pull: PIVX-Project#1780
Rebased-From: ec23964
Technically cs_sendProcessing is entirely useless now because it
is only ever taken on the one MessageHandler thread, but because
there may be multiple of those in the future, it is left in place

Github-Pull: PIVX-Project#1780
Rebased-From: c452676
Not needed as BIP34 is enforced since the genesis
(bitcoin/bitcoin@06d81ad)
Github-Pull: PIVX-Project#1775
Rebased-From: c894e8f
…oseTransaction.

decomposeCoinStake: Moved stake output address extraction to where it's used.

decomposeCoinStake: clarity on not performing any action if tx is not a coinstake.

refactor: decouple decompose zc spend tx from TransactionRecord::decomposeTransaction

decomposeTransaction: if there is no value on the map, return an empty string instead of crashing.

decomposeTransaction: decouple cold staking related tx decomposing from the monolithic method (for now).

In the future, this code should be merged with the credit/debit tx decomposing code to be able to show each output as a different record.

decomposeTransaction: removing unneded and duplicated IsMine method call.

decomposeTransaction: decouple credit transaction decomposing into its own method.

decomposeTransaction: decouple sendToSelf tx decomposing into its own method.

decomposeTransaction: duplicate isMine on MN record removed + few compiler warnings fixed.

decomposeTransaction: decouple debit transaction decomposing into its own method

decomposeTransaction: added some comments + removed code extra spacing.

decomposeTransaction: do not recalculate the tx size on every input/output loop.

decomposeTransaction: minor methods call standardization.

decomposeCreditTransaction: clean cached tx size. If it reached to this point, then the tx has credit and at least one output from the wallet

Github-Pull: PIVX-Project#1776
Rebased-From: 65a50c1
@Fuzzbawls Fuzzbawls self-assigned this Aug 13, 2020
@furszy
Copy link

furszy commented Aug 15, 2020

Need to add #1805 as well.

Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added #1805. utACK dc0ed71.

Merging this, we can open public testing for 4.2.1.

Copy link

@random-zebra random-zebra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK dc0ed71

@furszy furszy merged commit 70afd43 into PIVX-Project:4.2 Aug 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants