Commit graph

19523 commits

Author SHA1 Message Date
fanquake
f8237b8d50 rand: only try and use freeifaddrs if available
Github-Pull: #21486
Rebased-From: 87deac66aa
(cherry picked from commit e99d6d0c7c)
2021-09-22 02:05:02 +00:00
MarcoFalke
d92fb9693f fuzz: Bump FuzzedDataProvider.h
Latest version from 0cccccf0d2/compiler-rt/include/fuzzer/FuzzedDataProvider.h

Github-Pull: #21397
Rebased-From: fa7dc7ae95
(cherry picked from commit 8426e3a8a1)
2021-09-22 02:05:02 +00:00
MarcoFalke
9256eacadf fuzz: Bump FuzzedDataProvider.h
Latest version from https://raw.githubusercontent.com/llvm/llvm-project/70de7e0d9a95b7fcd7c105b06bd90fdf4e01f563/compiler-rt/include/fuzzer/FuzzedDataProvider.h

Github-Pull: #20812
Rebased-From: fafce49336
(cherry picked from commit 14e3f2a1c9)
2021-09-22 02:05:02 +00:00
practicalswift
07745976c7 fuzz: Update FuzzedDataProvider.h from upstream (LLVM)
Upstream revision: 6d0488f75b/compiler-rt/include/fuzzer/FuzzedDataProvider.h

Changes:
* [compiler-rt] FuzzedDataProvider: add ConsumeData and method.
* [compiler-rt] Fix a typo in a comment in FuzzedDataProvider.h.
* [compiler-rt] Add ConsumeRandomLengthString() version without arguments.
* [compiler-rt] Refactor FuzzedDataProvider for better readability.
* [compiler-rt] FuzzedDataProvider: make linter happy.
* [compiler-rt] Mark FDP non-template methods inline to avoid ODR violations.

Github-Pull: #20740
Rebased-From: e3d2ba7c70
(cherry picked from commit a48c9d3161)
2021-09-22 02:05:02 +00:00
Andrew Chow
337297d605 GUI: Write PSBTs to file with binary mode
Github-Pull: #bitcoin-core/gui#188
Rebased-From: cc3971c9ff
(cherry picked from commit 3a12672419)
2021-09-22 02:05:02 +00:00
Andrew Chow
a143b7b87d Disallow sendtoaddress and sendmany when private keys disabled
Github-Pull: #21201
Rebased-From: 0997019e76
(cherry picked from commit d6b5eb5fcc)
2021-09-22 02:05:02 +00:00
MarcoFalke
7233f69fc4 util: Disallow negative mocktime
Signed-off-by: practicalswift <practicalswift@users.noreply.github.com>

Github-Pull: #21043
Rebased-From: 3ddbf22ed1
(cherry picked from commit 08dada8456)
2021-09-22 02:05:02 +00:00
practicalswift
f0dec76142 net: Avoid UBSan warning in ProcessMessage(...)
Github-Pull: #21043
Rebased-From: f5f2f97168
(cherry picked from commit 95218ee95c)
2021-09-22 02:05:02 +00:00
Hennadii Stepanov
9e6c08d514 qt: Use "fusion" style on macOS Big Sur with old Qt
The "macintosh" style is broken on macOS Big Sur at least for Qt 5.9.8.

Github-Pull: #bitcoin-core/gui#177
Rebased-From: 4e1154dfd1
(cherry picked from commit 6dc58e9945)
2021-09-22 02:05:02 +00:00
randymcmillan
b514a872c3 raise helpMessageDialog
Github-Pull: bitcoin-core/gui#167
Rebased-From: 77114462f2
(cherry picked from commit e2ebc8567a)
2021-09-22 02:05:02 +00:00
Hennadii Stepanov
ce108b0061 qt: Stop the effect of hidden widgets on the size of QStackedWidget
Layouts of the hidden widgets, those are children of QStackedWidget,
could prevent to adjust the size of the parent widget in the
WalletFrame widget.

Github-Pull: bitcoin-core/gui#176
Rebased-From: af58f5b12c
(cherry picked from commit bdc64c9030)
2021-09-22 02:05:02 +00:00
Hennadii Stepanov
2ccf3823cf qt: Fix TxViewDelegate layout
This change (1) prevents overlapping date and amount strings,
and (2) guaranties that "eye" sign at the end of the watch-only
address/label is always visible.

Github-Pull: bitcoin-core/gui#176
Rebased-From: f0d04795e2
(cherry picked from commit 7bc4498234)
2021-09-22 02:05:02 +00:00
Hennadii Stepanov
5823cc3b43 qt: Add TransactionOverviewWidget class
Github-Pull: bitcoin-core/gui#176
Rebased-From: d439921406
(cherry picked from commit b7086e69ff)
2021-09-22 02:05:02 +00:00
Hennadii Stepanov
c89caab283 qt: Use layout manager for Create Wallet dialog
Github-Pull: bitcoin-core/gui#171
Rebased-From: d4feb6812a
(cherry picked from commit 0dba346a56)
2021-09-22 02:05:02 +00:00
Luke Dashjr
62c12bde50 Bugfix: GUI: Restore SendConfirmationDialog button default to "Yes"
The SendConfirmationDialog is used for bumping the fee, where "Send" doesn't really make sense

Github-Pull: #bitcoin-core/gui#148
Rebased-From: 8775691383
(cherry picked from commit 7bf3ed495b)
2021-09-22 02:05:02 +00:00
Vasil Dimov
0682f35ee4 net: allow CSubNet of non-IP networks
Allow creation of valid `CSubNet` objects of non-IP networks and only
match the single address they were created from (like /32 for IPv4 or
/128 for IPv6).

This fixes a deficiency in `CConnman::DisconnectNode(const CNetAddr& addr)`
and in `BanMan` which assume that creating a subnet from any address
using the `CSubNet(CNetAddr)` constructor would later match that address
only. Before this change a non-IP subnet would be invalid and would not
match any address.

Github-Pull: #20852
Rebased-From: 94d335da7f
(cherry picked from commit c33fbab25c)
2021-09-22 02:05:02 +00:00
Anthony Towns
81ea0ed4a6 tests: Add fuzzing harness for versionbits
Github-Pull: #21380
Rebased-From: 1639c3b76c
(cherry picked from commit e775b0a6dd)
2021-09-22 02:05:02 +00:00
Anthony Towns
b8d678c9c9 tests: check never active versionbits
(cherry picked from commit 0c471a5f30)
2021-09-22 02:05:02 +00:00
Anthony Towns
c3bd45e5dd tests: more helpful errors for failing versionbits tests
Co-authored-by: Sjors Provoost <sjors@sprovoost.nl>
(cherry picked from commit 3ba9283a47)
2021-09-22 02:05:02 +00:00
Amiti Uttarwar
33d10b1f00 [doc] Add permissions to the getpeerinfo help.
This field was already being returned, but the RPCHelpMan did not indicate
this. So, this PR updates the help text to match.

Github-Pull: #20756
Rebased-From: 667d203687
(cherry picked from commit b1c0f97483)
2021-09-22 02:05:02 +00:00
Ben Carman
4bca4c28c2 rpc: Add missing description of vout in getrawtransaction help text
Github-Pull: #20731
Rebased-From: b23349b880
(cherry picked from commit 1fda7db64f)
2021-09-22 02:05:02 +00:00
Hennadii Stepanov
492ed0947f qt: Align layout of checkboxes
Github-Pull: bitcoin-core/gui#155
Rebased-From: e71b656f31
(cherry picked from commit ef7a155cf0)
2021-09-22 02:05:02 +00:00
Adam Jonas
6299124c9c doc: warn that incoming conns are unlikely when not using default ports
Github-Pull: #20668
Rebased-From: 010eed3ce0
(cherry picked from commit 84e8d5467f)
2021-09-22 02:05:02 +00:00
Sjors Provoost
14d7d20c68 Move signet onion seed from v2 to v3
Github-Pull: #20660
Rebased-From: 3e6657a14d
(cherry picked from commit 8273ea3b8d)
2021-09-22 02:05:01 +00:00
Pieter Wuille
3bfce85eaf Improve heuristic hex transaction decoding
Whenever both encodings are permitted, try both, and if only one succeeds,
return that one. Otherwise prefer the one for which the heuristic sanity
check passes. If that is the case for neither or for both, return the
extended-permitting deserialization.

Github-Pull: #20595
Rebased-From: 39c42c4420
(cherry picked from commit 1caa32e3f2)
2021-09-22 02:05:01 +00:00
Jon Atack
b4eb953986 wallet, bugfix: allow send to take string fee rate values
Github-Pull: #20573
Rebased-From: ce207d6b93
(cherry picked from commit 06c84232b3)
2021-09-22 02:05:01 +00:00
Pieter Wuille
f15c72cbd2 Send and require SENDADDRV2 before VERACK
See the corresponding BIP change: https://github.com/bitcoin/bips/pull/1043

Github-Pull: #20564
Rebased-From: 1583498fb6
(cherry picked from commit bead935470)
2021-09-22 02:05:01 +00:00
Pieter Wuille
c117c6c125 Don't send 'sendaddrv2' to pre-70016 software
Github-Pull: #20564
Rebased-From: c5a8919660
(cherry picked from commit 9e806887a8)
2021-09-22 02:05:01 +00:00
Jon Atack
a97c53172a Use the correct incremental fee constant in bumpfee help
and remove redundant units ("Must be at least 1.000 sat/vB sat/vB" -> "1.00 sat vB")

Github-Pull: #20426
Rebased-From: 9f08780dd7
(cherry picked from commit 6313362553)
2021-09-22 02:05:01 +00:00
Jon Atack
765c2b4d17 Allow zero-fee fundrawtxn and walletcreatefundedpsbt calls
A check to raise an error on zero-fee txns was mistakenly extended in commit
a0d4957 from the bumpfee and send{toaddress, many} RPCs to also include
fundrawtransaction and walletcreatefundedpsbt.

This commit overrides zero fee rate checking for these two RPCs, not only for
the feeRate (BTC/kvB) arg to return to previous behavior, but also for the new
fee_rate (sat/vB) arg.

Github-Pull: #20426
Rebased-From: 1b3d700928
(cherry picked from commit 54e1edcc2b)
2021-09-22 02:05:01 +00:00
Niklas Gögge
2ca3943fdf build: Avoid secp256k1.h include from system
GitHub-Pull: #20469
Rebase-From: e95aaefe25
(cherry picked from commit 01b647b1a2)
2021-09-22 02:05:01 +00:00
Jon Atack
df1bd79314 wallet: fix and improve upgradewallet error responses
(cherry picked from commit ca8cd893bb)
2021-09-22 02:05:01 +00:00
Jon Atack
77627d8efd wallet: fix and improve upgradewallet result responses
(cherry picked from commit 99d56e3571)
2021-09-22 02:05:01 +00:00
Andrew Chow
92251542e5 Don't upgrade to HD split if it is already supported
It is unnecessary to upgrade to FEATURE_HD_SPLIT if this feature is
already supported by the wallet. Because upgrading to FEATURE_HD_SPLIT
actually requires upgrading to FEATURE_PRE_SPLIT_KEYPOOL, users would
accidentally be upgraded to FEATURE_PRE_SPLIT_KEYPOOL instead of nothing
being done.

Fixes the issue described at
https://github.com/bitcoin/bitcoin/pull/20403#discussion_r526063920

(cherry picked from commit 2498b04ce8)
2021-09-22 02:05:01 +00:00
Jon Atack
9c3df80c40 wallet: refactor GetClosestWalletFeature()
(cherry picked from commit c46c18b788)
2021-09-22 02:05:01 +00:00
MarcoFalke
ae26ff27a9 wallet: Do not treat default constructed types as None-type
(cherry picked from commit fa69c2c784)
2021-09-22 02:05:01 +00:00
MarcoFalke
2fe52979ea refactor: Change pointer to reference because it can not be null
(cherry picked from commit fac4e136fa)
2021-09-22 02:05:01 +00:00
Luke Dashjr
4f36e4cfc6 RPC/Wallet: unloadwallet: Clarify docs/error when both the RPC endpoint and wallet_name parameter specify a wallet
(cherry picked from commit b1f59d55d9)
2021-09-22 02:05:01 +00:00
Andrew Poelstra
03b835c887 PSET: output warnings in decodepsbt and analyzepsbt about blinding status 2021-09-21 21:59:16 +00:00
Andrew Poelstra
694ec795e4 PSET: fix asset proof generation and verification
A couple issues with this -- one is that it was verifying the asset
commitment against itself, rather than against the explicit asset,
and the other is that the verification logic had an extra `== 0` at
the end which inverted the verification check.

Both pretty embarassing to have not caught in review..
2021-09-21 21:59:10 +00:00
Andrew Poelstra
c6f801d4ce PSET: encapsulate blind proof checks into one method 2021-09-21 20:33:31 +00:00
Andrew Poelstra
35cfda73b9 PSET: do not assume in GetUnsignedTx that explicit amounts/assets are available 2021-09-21 20:33:31 +00:00
Andrew Poelstra
c88eb96e74 pset: check that we can get the blinding factors from any IsMine outputs before signing
Arguably we should do this for signrawtransaction too but it'd be a
lot of duplicated code for a deprecated workflow.
2021-09-21 20:33:31 +00:00
Andrew Poelstra
9c55d0a175 pset: only check asset/amount proofs in case both explicit+blinded values are provided 2021-09-21 20:33:28 +00:00
Andrew Poelstra
cf4136b3b0 SIGHASH_RANGEPROOF and asset issuance rangeproofs 2021-09-20 22:10:47 +00:00
Andrew Poelstra
1b23ad7093 pset: fix encoding of blinded asset issuances 2021-09-19 20:58:07 +00:00
Andrew Poelstra
9c3c61aa0a psbt: make sure rangeproofs are present in the confidential version of the unsigned tx
These rangeproofs are covered by signature in both Taproot and
SIGHASH_RANGEPROOF signatures, so they need to be present.
2021-09-19 14:52:47 +00:00
Andrew Poelstra
7a3cbda848 sign.cpp: turn on SIGHASH_SCRIPT_RANGEPROOF when checking already-existing signatures
Currently when a user uses `signrawtransaction` on a transaction that is
already partially signed with SIGHASH_RANGEPROOF signatures, the existing
signatures will be deleted because they are not recognized as valid. This
makes it impossible to collabratively sign transactions using this RPC.
Fix this.
2021-09-19 14:18:13 +00:00
Andrew Poelstra
ab5b376b72 SignatureHash: fix rangeproof hash for SIGHASH_RANGEPROOF
The logic for computing the uncached version of the sighash changed during
the 0.21 rebase, such that it no longer matched the cached version. As the
changed hash is used during signing (not verification!), this was not a
forking change (and our existing functional test would have caught such a
forking change since it uses Python to independently compute the hash).
But it still broke signing.

Test in next commit.
2021-09-19 14:08:56 +00:00
Andrew Poelstra
f7f9555792
Merge ElementsProject/elements#1044: Define Taproot activation parameters for Liquid
3cb9612faa test: add test for Taproot activation (Andrew Poelstra)
5291c0d9d9 chainparams: add undocumented regtest/testnet only -con_taproot_signal_start option (Andrew Poelstra)
cc6b933478 add missing taproot activation params for Liquid v1 (Andrew Poelstra)
bec6bcf31b versionbits: allow specific deployments to override the signalling/threshold values (Andrew Poelstra)

Pull request description:

  Sets Taproot to start signalling around noon (California time) on Nov 1, 2021, assuming 95% of blocks are produced between now and then.

  Will activate after one week of 100% signalling. If we can pull this off on the first or second try, we will beat Bitcoin which currently looks like it will activate on Nov 16.

  **Edit:** actually, even without Speedy Trial, there is one full period (week) where Taproot will be "locked in" but not "active". So it will activate on Nov 15 at the earliest.

ACKs for top commit:
  achow101:
    ACK 3cb9612faa

Tree-SHA512: c3a80d39ba86a0d762a3057cb9c45e379c70c2daee8ff2e54978a4c32118c935c8909d872ac9f873e283441c52c1974c06268f10dc7bf9e9e000c21063ac84d7
2021-09-18 03:22:30 +00:00