Commit Graph

21195 Commits

Author SHA1 Message Date
PastaPastaPasta
47ad9ab146
Merge pull request #4706 from kittywhiskers/libnatpmp
merge bitcoin#18077...22397: Add NAT-PMP port forwarding support
2022-03-05 11:03:44 -06:00
Odysseas Gabrielides
64f7a1e291
Revert "feat: introduce devnetVersion for devnet breaking changes; always use DGW on devnets (#4685)" (#4712)
This reverts commit a3b4aab936.
2022-02-28 10:43:00 -06:00
UdjinM6
932a75b85f
wallet: Fix CanGenerateKeys (#4705)
Using wallet flags should be enough here, no need for any additional conditions.

NOTE: Wallets created prior to 4627 have wallet version set to FEATURE_HD even when no HD chain was initialized, that's why they have issues without this fix.

Fixes 4699
2022-02-26 16:03:21 -06:00
PastaPastaPasta
e8b8568d9e
Merge pull request #4702 from kittywhiskers/bench2
merge bitcoin#16540...#17542: benchmarks (part 2)
2022-02-26 13:09:31 -06:00
Kittywhiskers Van Gogh
7d989179f9
refactor(evo): introduce IsTriviallyValid() to CheckPro*Tx objects (#4696)
* evo: introduce IsTriviallyValid() to CheckPro*Tx objects

* evo: relocate Check* and CheckPro*Tx logic to deterministicmns (move-only)

* evo: relocate masternode state and chainlock sig logic to dedicated files (move-only)

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* evo: issue penalty for CheckInputsHash failure when validating ProUp*Tx

Co-authored-by: PastaPastaPasta <PastaPastaPasta@users.noreply.github.com>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-02-26 12:50:35 -06:00
Kittywhiskers Van Gogh
4e9fe85700 merge bitcoin#22397: Fix macOS Apple Silicon build with miniupnpc and libnatpmp 2022-02-26 17:49:13 +05:30
Kittywhiskers Van Gogh
c382730033 merge bitcoin#21209: use newer source for libnatpmp 2022-02-26 17:49:13 +05:30
Kittywhiskers Van Gogh
d23a3c8af8 merge bitcoin#21320: fix libnatpmp macos cross compile 2022-02-26 17:49:13 +05:30
Kittywhiskers Van Gogh
687c7d4a5d merge bitcoin#18077: Add NAT-PMP port forwarding support 2022-02-26 17:49:13 +05:30
Kittywhiskers Van Gogh
0b4eddc359 merge bitcoin#13204: Faster sigcache nonce 2022-02-26 10:47:54 +05:30
Kittywhiskers Van Gogh
01dc196162 merge bitcoin#17542: Create test utility library from src/test/util 2022-02-26 10:45:13 +05:30
Kittywhiskers Van Gogh
e36ee01f99 merge bitcoin#17384: Create new test library 2022-02-26 10:45:13 +05:30
Kittywhiskers Van Gogh
52e62b6601 merge bitcoin#17357: Add fuzzing harness for Bech32 encoding/decoding 2022-02-26 10:45:13 +05:30
Kittywhiskers Van Gogh
7b74a34aba merge bitcoin#17292: Add new mempool benchmarks for a complex pool 2022-02-26 10:45:13 +05:30
Kittywhiskers Van Gogh
d34c016e3f merge bitcoin#17228: Add RegTestingSetup to setup_common 2022-02-26 10:45:13 +05:30
Kittywhiskers Van Gogh
61e2c6d228 merge bitcoin#17183: test/bench: dedup Build{Crediting,Spending}Transaction() 2022-02-26 10:45:13 +05:30
Kittywhiskers Van Gogh
831b0057d9 merge bitcoin#17009: Add EvalScript(...) fuzzing harness 2022-02-26 10:45:13 +05:30
Kittywhiskers Van Gogh
5086ad7c2f merge bitcoin#16540: Add ASSERT_DEBUG_LOG to unit test framework 2022-02-26 10:37:36 +05:30
Odysseas Gabrielides
3ecfa04a72
Crash fix (#4697)
* Crash fix

* Keep verified LLMQ connections

* Revert "Keep verified LLMQ connections"

This reverts commit d44bba663a.

* Refactoring
2022-02-24 11:08:22 -06:00
Odysseas Gabrielides
a1027a3e8e
Keep verified LLMQ connections (#4701) 2022-02-23 13:03:31 -06:00
UdjinM6
db784fd4aa
Merge pull request #4695 from UdjinM6/bp14021
Backport 14021 and 15433
2022-02-23 12:56:08 +03:00
UdjinM6
7acaa0a93a
Fix "cs_main not held" in SyncObjects (#4694)
* Fix "cs_main not held" in SyncObjects

* use WITH_LOCK
2022-02-23 12:55:37 +03:00
MeshCollider
7d02a25c70
Merge #15433: Use a single wallet batch for UpgradeKeyMetadata
0bedcbafd Use a single wallet batch for UpgradeKeyMetadata (Jonas Schnelli)

Pull request description:

  Opening wallets (the first time) after #14021 took on my end around 30 seconds due to the keymetadata migration (tested on regtest).

  Using a single wallet batch reduces the required time for the migration down to <1s on my system for a default 2k keypool wallet.

Tree-SHA512: f68739e452d382f5294186f47511b94884a1a0868688dd3179034a7e091a67f93bc9dd45cdfc9fa6b1fe90362772b719278012f2f56b752b803c87db8597a7b0
2022-02-18 03:42:05 +03:00
MeshCollider
ed0e2dd075
Merge #14021: Import key origin data through descriptors in importmulti (+ changes from PRs partially merged earlier: 15368, 15749)
cb3511b9d Add release notes for importing key origin info change (Andrew Chow)
4c75a69f3 Test importing descriptors with key origin information (Andrew Chow)
02d6586d7 Import KeyOriginData when importing descriptors (Andrew Chow)
3d235dff5 Implement a function to add KeyOriginInfo to a wallet (Andrew Chow)
eab63bc26 Store key origin info in key metadata (Andrew Chow)
345bff601 Remove hdmasterkeyid (Andrew Chow)
bac8c676a Add a method to CWallet to write just CKeyMetadata (Andrew Chow)
e7652d3f6 Add WriteHDKeypath function and move *HDKeypath to util/bip32.{h,cpp} (Andrew Chow)
c45415f73 Refactor keymetadata writing to a separate method (Andrew Chow)

Pull request description:

  This PR allows for key origin data as defined by the descriptors document to be imported to the wallet when importing a descriptor using `importmulti`. This allows the `walletprocesspsbt` to include the BIP 32 derivation paths for keys that it is watching that are from a different HD wallet.

  In order to make this easier to use, a new field `hdmasterkeyfingerprint` has been added to `getaddressinfo`. Additionally I have removed `hdmasterkeyid` as was planned. I think that this API change is fine since it was going to be removed in 0.18 anyways. `CKeyMetadata` has also been extended to store key origin info to facilitate this.

Tree-SHA512: 9c7794f3c793da57e23c5abbdc3d58779ee9dea3d53168bb86c0643a4ad5a11a446264961e2f772f35eea645048cb60954ed58050002caee4e43cd9f51215097
2022-02-18 03:42:05 +03:00
UdjinM6
b0a8522d9d
Various translation related fixes (#4693)
* Move GovernanceList declaration up to solve lupdate warning

fixes `Qualifying with unknown namespace/class ::GovernanceList`

* mark non-translatable strings as such

* translate more strings in Governance tab

* fix `Class 'ProposalModel' lacks Q_OBJECT macro`
2022-02-15 19:32:38 +03:00
PastaPastaPasta
9789a42088
Merge pull request #4575 from Munkybooty/backports-0.19-pr7
Backports 0.19 pr7
2022-02-15 23:31:21 +07:00
UdjinM6
aa7c03fe2a
Avoid using raw pointers in GetAllNewerThan results (#4649)
pass copies around, fix gui updates and mem leaks
2022-02-15 19:28:55 +03:00
UdjinM6
88876573ff
Fix get_future data race in ctpl (#4690)
See https://wg21.cmeerw.net/lwg/msg7337 and https://wg21.cmeerw.net/lwg/issue2412
2022-02-15 19:28:29 +03:00
Kittywhiskers Van Gogh
0b3582ddd7
depends: bump bls-dash to 1.2.0, cmake to 3.22.2, relic to aecdcae (#4681)
* depends: bump cmake to 3.22.2

Contains additional patches to mitigate errors

```
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)
CMake Error at Utilities/cmcurl/CMakeLists.txt:562 (message):
  Could not find OpenSSL.  Install an OpenSSL development package or
  configure CMake with -DCMAKE_USE_OPENSSL=OFF to build without OpenSSL.
```

* depends: bump bls-dash to 1.2.0 (979f423234)

* depends: bump relic to aecdcae795
2022-02-15 22:12:11 +07:00
PastaPastaPasta
b26eaf6954
build: allow building without openssl, enables native m1 development builds (#4683)
* build: allow building without openssl, enables native m1 development builds

* Update configure.ac, according to review

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* introduce `--with-openssl`

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-02-13 11:50:23 +03:00
PastaPastaPasta
a3b4aab936
feat: introduce devnetVersion for devnet breaking changes; always use DGW on devnets (#4685)
* feat: introduce devnetVersion as a method for breaking changes to devnets

include devnetVersion in expected version for devnet connections

* feat: always use DGW on devnets

* fix p2p_connect_to_devnet.py

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-02-13 11:44:49 +03:00
thephez
dcc00ac8e9
test: skip test properly if zmq missing (#4684) 2022-02-12 04:33:46 +07:00
PastaPastaPasta
fe0ebb3c04
refactor: fix numerous compilation warnings (#4682)
* style: use clang-tidy style named parameters

* refactor: make IsTimeOutOfBounds testable by having current time be a parameter

* style: use x-> not (*x).

* refactor: make SelectCoinsGroupedByAddresses return a vector, remove out param

previous semantics was return false if the vecTally vector was empty. Now we just let the caller check if it is empty or not

* refactor: fix some sign-compare warnings

* refactor: consistently pre-declare stuff as struct / class inline with underlying type

* refactor: don't return const bool

* refactor: use ref to string

* refactor: use = default for CompactTallyItem

* refactor: adjust "initialization" ordering

* refactor: adjust how we handle negatives in GetProjectedMNPayees, use std::min

* refactor: don't bind a reference to a temporary value

* refactor: use a ref

* refactor: ensure attempt in SelectMemberForRecovery is non-negative.

* refactor: remove unused this capture

* refactor: fix numerous sign-compare warnings

* refactor: more consistently use size_t, use empty()
2022-02-11 19:15:26 +03:00
AJ ONeal
5e832e070d
docs: add header to binary download info (#4678)
* docs: add header to binary download info

* docs: update link from get-dash to downloads

Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
2022-02-11 00:58:53 +03:00
PastaPastaPasta
ea54faa50b
fix: avoid requesting transactions from 100+ peers when we are heavily connected and receive islock with unknown tx (#4680)
Changes the logic to only request from up to 4 peers, and to prefer masternodes for these peers. In practice, even if these four nodes do not forward the transaction, it doesn't matter, and we will receive the tx soon via inv
2022-02-11 00:57:51 +03:00
UdjinM6
52d3546a70
Partially revert 4652 (#4674)
Using `string_view` results in things like `nSessionDenom: 2 (\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00)` etc. for some reason
2022-02-02 12:08:50 +03:00
PastaPastaPasta
ac010d9bf3
feat: Implement support for P2SH payouts for proposals (#4672)
* GOVSCRIPT deployment

* replace DEPLOYMENT_GOVSCRIPT with DEPLOYMENT_GOV_FEE

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-02-02 12:08:05 +03:00
UdjinM6
359b5f3dff Do not reset validity flags for -checklevels below 3, fix wallet_balance.py 2022-01-30 18:31:00 -05:00
MarcoFalke
1c908fbd49 Merge #16079: wallet_balance.py: Prevent edge cases
bb41e632ca wallet_balance.py: Prevent edge cases (Steven Roose)

Pull request description:

  I ran into this edge case when running the test on Elements. I had a 0-value output as change.

ACKs for commit bb41e6:

Tree-SHA512: ef4c25289cafcdb4437f11ed537664dff5afedcefab75a46f985d3be70551de2d3bc8e9cfcb22c0f3d7d2eb95ff40df78b8d01dbacbf90c36bca00426937b0a2
2022-01-30 18:31:00 -05:00
MarcoFalke
c39bbf8d39 Merge #15758: qa: Add further tests to wallet_balance
fa79a783d6 test: Add reorg test to wallet_balance (MarcoFalke)
fad03cd046 test: Check that wallet txs not in the mempool are untrusted (MarcoFalke)
fa195315e6 test: Add getunconfirmedbalance test with conflicts (MarcoFalke)
fa464e8211 test: Add wallet_balance test for watchonly (MarcoFalke)

Pull request description:

  Second commit can be reviewed with `--ignore-all-space`

ACKs for commit fa79a7:
  jnewbery:
    utACK fa79a783d63060dc6a8521c1de58b158979a59e9

Tree-SHA512: ec4919a3c93b6dcb35d58e7c65bdffe7f4c8cb87b9287f3679631c1823ef5bd72789f233def94e60c1ab332711601751645566f5997ce250af55b328ed60e917
2022-01-30 18:31:00 -05:00
UdjinM6
fbeb31190b 16322 followup 2022-01-30 18:31:00 -05:00
Wladimir J. van der Laan
c516869bcf Merge #16322: wallet: Fix -maxtxfee check by moving it to CWallet::CreateTransaction
0d101a340c44841cbbc5982d55354b1787bc39e2 test: Add test for maxtxfee option (MarcoFalke)
177550101b600ccb32886695326eb72cd9752c8b wallet: Remove unreachable code in CreateTransaction (MarcoFalke)
5c1b9714cb0a13be28324f91f4ec9ca66a1de8c7 wallet: Fix -maxtxfee check by moving it to CWallet::CreateTransaction (João Barbosa)

Pull request description:

  Follow up to #16257, this PR makes `bumpfee` aware of `-maxtxfee`.

  It also prevents dangling locked unspents when calling `fundrawtransaction` - because the previous check was after `LockCoin`.

ACKs for top commit:
  MarcoFalke:
    re-ACK 0d101a340c44841cbbc5982d55354b1787bc39e2, only change is small test fixup

Tree-SHA512: 3464b24ae7cd4e72ed41438c6661828ba1304af020f05da62720b23668ae734e16cf47c6d97e150cc84ef631ee099b16fc786c858f3d089905845437338fd512
2022-01-30 18:31:00 -05:00
UdjinM6
5a8a95c494 12909 followup 2022-01-30 18:31:00 -05:00
MarcoFalke
247649ac42 Merge #12582: Fix ListCoins test failure due to unset g_wallet_allow_fallback_fee
7ba2d57852 Fix ListCoins test failure due to unset g_wallet_allow_fallback_fee (Russell Yanofsky)

Pull request description:

  New global variable was introduced in #11882 and not setting it causes:

  ```
  wallet/test/wallet_tests.cpp(638): error in "ListCoins": check wallet->CreateTransaction({recipient}, wtx, reservekey, fee, changePos, error, dummy) failed
  wallet/test/wallet_tests.cpp(679): error in "ListCoins": check list.begin()->second.size() == 2 failed [1 != 2]
  wallet/test/wallet_tests.cpp(686): error in "ListCoins": check available.size() == 2 failed [1 != 2]
  wallet/test/wallet_tests.cpp(705): error in "ListCoins": check list.begin()->second.size() == 2 failed [1 != 2]
  ```

  It's possible to reproduce the failure reliably by running:

  ```
  src/test/test_bitcoin --log_level=test_suite --run_test=wallet_tests/ListCoins
  ```
  Failures happen nondeterministically because boost test framework doesn't run tests in a specified order, and tests that run previously can set the global variables and mask the bug.

  This is similar to bugs #12150 and #12424. Example travis failures are:

  https://travis-ci.org/bitcoin/bitcoin/jobs/348296805#L2676
  https://travis-ci.org/bitcoin/bitcoin/jobs/348362560#L2769
  https://travis-ci.org/bitcoin/bitcoin/jobs/348362563#L2824

Tree-SHA512: ca37b554a75c12ac2d534de62bf74eb9e0b29e4399ebf1fa10053a40887e55e9e7135f754a01e5a67499cc8677ae226542146b370b1e83d08bb63d79ff379073
2022-01-30 18:31:00 -05:00
UdjinM6
79f881b141 Do not create non-standard txes in feature_addressindex.py 2022-01-30 18:31:00 -05:00
MeshCollider
0f6c7b98a5 Merge #16402: Remove wallet settings from chainparams
fa4a605a4c611abe9af4c18aab20f4d1d039170f Remove wallet settings from chainparams (MarcoFalke)

Pull request description:

  Feels a bit odd to have wallet setting in the chainparams, so remove them from there

ACKs for top commit:
  promag:
    ACK fa4a605a4c611abe9af4c18aab20f4d1d039170f, missed s/2018/2019?
  practicalswift:
    utACK fa4a605a4c611abe9af4c18aab20f4d1d039170f
  darosior:
    ACK fa4a605a4c611abe9af4c18aab20f4d1d039170f

Tree-SHA512: 2b3a5ee85d36af290d7db80bed1339e3c684607f1ce61cc65c906726e9174e40325fb1f67a34d8780f2a61fa39a1785e7c3a1cef5b6d6c364f38db5300cdbe3a
2022-01-30 18:31:00 -05:00
MarcoFalke
8ca90f3f99 Merge #15891: test: Require standard txs in regtest by default
fa89badf887dcc01e5bdece248b5e7d234fee227 test: Require standard txs in regtest (MarcoFalke)
fa9b4191609c3ef75e69d391eb91e4d5c1e0bcf5 test: Add test that mainnet requires standard txs (MarcoFalke)
fa613ca0a8f99c4771859de9e571878530d3ecb5 chainparams: Remove unused fMineBlocksOnDemand (MarcoFalke)

Pull request description:

  I don't see a reason why regtest should allow non-standard txs, as it makes testing mainnet behaviour such as #15846 unnecessarily hard and unintuitive.

  Of course, testnet policy remains unchanged to allow propagation of non-standard txs.

ACKs for top commit:
  ajtowns:
    ACK fa89badf887dcc01e5bdece248b5e7d234fee227

Tree-SHA512: c4c675affb054868850bd2683aa07f4c741a448cbacb2ea8334191e105f426b0790fe6a468be61e9c5880d24154f7bf1c7075051697172dce92180c1bc3a1c90
2022-01-30 18:31:00 -05:00
Wladimir J. van der Laan
41f9bfaee6 Merge #11882: Disable default fallbackfee on mainnet
3f592b8 [QA] add wallet-rbf test (Jonas Schnelli)
8222e05 Disable wallet fallbackfee by default on mainnet (Jonas Schnelli)

Pull request description:

  Removes the default fallback fee on mainnet (but keeps it on testnet/regtest).

  Transactions using the fallbackfee in case the fallback fee has not been set are getting rejected.

Tree-SHA512: e54d2594b7f954e640cc513a18b0bfbe189f15e15bdeed4fe02b7677f939bca1731fef781b073127ffd4ce08a595fb118259b8826cdaa077ff7d5ae9495810db
2022-01-30 18:30:28 -05:00
MarcoFalke
356785cdaa Merge #16293: test: Make test cases separate functions
faf8318c55a6001270a6fc8ed2298767099bafba test: Split fundrawtx test into subtests (MarcoFalke)
fa6fba3bc8013d7f813edd71f152d86eab907e4d test: Make local symbols in run_test members (MarcoFalke)

Pull request description:

  This prevents scope-leak of symbols that are supposed to be local to one test case.

Top commit has no ACKs.

Tree-SHA512: 9b2a4ca2cdd631ef915d2f7e6cd62375df9a0919448350aa6e5ae4aa8a8fe3ba53870f7a9a25a57736894b4e3a45e861018253ed2d57d9a64c2bb65fa270fad8
2022-01-30 18:29:41 -05:00
Wladimir J. van der Laan
02e5436bb8 Merge #16451: Remove CMerkleTx
05b56d1c937b7667ad51400d2f9fb674af72953f [wallet] Remove CMerkleTx serialization logic (John Newbery)
783a76f23ba4f33b6e6f609eaf3bf41afd9bcd6f [wallet] Flatten CWalletTx class hierarchy (John Newbery)
b3a9d179f23f654b8fba63924bbca5fd31ad4bb0 [wallet] Move CMerkleTx functions into CWalletTx (John Newbery)

Pull request description:

  CMerkleTx is only used as a base class for
  CWalletTx. It was previously also used for vtxPrev which
  was removed in 93a18a3650.

  This PR moves all of the CMerkleTx members and logic
  into CWalletTx. The CMerkleTx class is kept for deserialization
  and serialization of old wallet files.

  This makes the refactor in #15931 cleaner.

ACKs for top commit:
  laanwj:
    ACK 05b56d1c937b7667ad51400d2f9fb674af72953f. Looks good to me.

Tree-SHA512: 3d3a0069ebb536b12a328f1261e7dc55158a71088d445ae4b4ace4142c432dc296f58c8183b1922e54a60b8cc77e9d17c3dce7478294cd68693594baacf2bab3
2022-01-30 18:29:30 -05:00