Commit graph

202 commits

Author SHA1 Message Date
Andrew Poelstra
bf86dda30c Merge 5802ea6bd3 into merged_master (Bitcoin PR #19453) 2020-11-26 01:09:23 +00:00
Andrew Poelstra
dd30279412 Merge 47a30ef0c6 into merged_master (Bitcoin PR #19133) 2020-11-26 01:09:10 +00:00
Andrew Poelstra
11afdcc66a Merge 9ccaee1d5e into merged_master (Bitcoin PR #19004) 2020-11-26 01:08:51 +00:00
Andrew Poelstra
3b7c182626 Merge 24f7029064 into merged_master (Bitcoin PR #18594) 2020-11-26 01:08:49 +00:00
Andrew Poelstra
08d74600ea Merge 5dcb061589 into merged_master (Bitcoin PR #18702) 2020-11-26 01:08:28 +00:00
Andrew Poelstra
fd37b7c5d6 Merge 54f812d9d2 into merged_master (Bitcoin PR #18673) 2020-11-26 01:08:23 +00:00
Andrew Poelstra
e978e137dd Merge 4eb1eeb02c into merged_master (Bitcoin PR #18504) 2020-11-26 01:08:16 +00:00
Andrew Poelstra
f3fc8e9b77 Merge 6ab96ec546 into merged_master (Bitcoin PR #18574) 2020-11-26 01:08:15 +00:00
Andrew Poelstra
cc668250eb Merge 97aadf98d0 into merged_master (Bitcoin PR #16117) 2020-11-26 01:07:50 +00:00
Andrew Poelstra
2c846f5fa3 Merge da3611a580 into merged_master (Elements PR #808) 2020-11-26 00:29:43 +00:00
Andrew Poelstra
009bc2fdfb Merge 99813a9745 into merged_master (Bitcoin PR #17829) 2020-11-14 16:52:02 +00:00
Andrew Poelstra
0c0b496469 Merge 5aee0e2163 into merged_master (Bitcoin PR #17650) 2020-11-14 16:51:53 +00:00
Andrew Poelstra
daf2eab951 Merge 7967104aee into merged_master (Bitcoin PR #17368) 2020-11-09 23:10:07 +00:00
Andrew Poelstra
74509094d0 Merge edd9d0781b into merged_master (Bitcoin PR #17302) 2020-11-09 21:20:47 +00:00
Andrew Poelstra
578080081e Merge 5728f88d64 into merged_master (Bitcoin PR #17280) 2020-11-09 21:20:47 +00:00
Andrew Poelstra
fdb06a8ceb Merge 4c1090c882 into merged_master (Bitcoin PR #17279) 2020-11-09 21:20:46 +00:00
Andrew Poelstra
821f5256a5 Merge 46d6930f8c into merged_master (Bitcoin PR #16659) 2020-11-09 21:20:41 +00:00
Andrew Poelstra
08cf271777 Merge 5a3dd93594 into merged_master (Bitcoin PR #17131) 2020-11-09 21:20:40 +00:00
Andrew Poelstra
009af6607f Merge f4a0d27e85 into merged_master (Bitcoin PR #13716) 2020-11-09 21:20:33 +00:00
Andrew Poelstra
a191197ace Merge 83112db129 into merged_master (Bitcoin PR #15864) 2020-11-09 21:20:16 +00:00
Andrew Poelstra
9c3480fea9 Merge 3a3d8b8357 into merged_master (Bitcoin PR #16097) 2020-11-09 21:20:11 +00:00
Andrew Poelstra
83019c2acd Merge d960d5ca99 into merged_master (Bitcoin PR #16362) 2020-11-09 21:20:08 +00:00
Andrew Poelstra
f11c2f3dab Merge 357488f660 into merged_master (Bitcoin PR #16240) 2020-11-09 03:58:20 +00:00
Andrew Poelstra
e33ff205ee Merge 1a274bce4b into merged_master (Bitcoin PR #16205) 2020-11-06 15:20:15 +00:00
Andrew Poelstra
760d7ce6f0 Merge c94852e791 into merged_master (Bitcoin PR #15564) 2020-10-27 23:23:30 +00:00
Andrew Poelstra
5ae23eb085 Merge 887f57eb72 into merged_master (Bitcoin PR #15566) 2020-10-27 23:22:22 +00:00
Jon Atack
f20b359bb9
cli: reduce DefaultRequestHandler memory allocations 2020-07-05 16:39:17 +02:00
Jon Atack
4b859cfff9
cli: add multiwallet capability to GetNewAddress and -generate 2020-06-02 08:50:51 +02:00
Jon Atack
4818124137
cli: create bitcoin-cli -generate command 2020-06-02 08:50:45 +02:00
Jon Atack
ff41a36900
cli: extract ParseResult() and ParseError()
and make callable higher up with (nRet == 0) check.
2020-06-02 08:50:41 +02:00
Harris
f4185b26d9
cli: create GenerateToAddressRequestHandler class 2020-06-02 08:50:36 +02:00
Jon Atack
f7c65a3350
cli: create GetNewAddress() 2020-06-02 08:24:29 +02:00
MarcoFalke
9ccaee1d5e
Merge #19004: refactor: Replace const char* to std::string
c57f03ce17 refactor: Replace const char* to std::string (Calvin Kim)

Pull request description:

  Rationale: Addresses #19000
  Some functions should be returning std::string instead of const char*.
  This commit changes that.

  Main benefits/reasoning:

  1.  The functions never return nullptr, so returning a string makes code at call sites easier to review (reviewers don't have to read the source code to verify that a nullptr is never returned)
  2. All call sites convert to string anyway

ACKs for top commit:
  MarcoFalke:
    re-ACK c57f03ce17 (no changes since previous review) 🚃
  Empact:
    Fair enough, Code Review ACK https://github.com/bitcoin/bitcoin/pull/19004/commits/c57f03ce1741b38af448bec7b22ab9f8ac21f067
  practicalswift:
    ACK c57f03ce17 -- patch looks correct
  hebasto:
    re-ACK c57f03ce17

Tree-SHA512: 9ce99bb38fe399b54844315048204cafce0f27fd8f24cae357fa7ac6f5d8094d57bbf5f5c1f5878a65f2d35e4a3f95d527eb17f49250b690c591c0df86ca84fd
2020-05-27 07:16:10 -04:00
Calvin Kim
c57f03ce17 refactor: Replace const char* to std::string
Some functions should be returning std::string instead of const char*.
This commit changes that.
2020-05-22 01:40:31 +09:00
Jon Atack
903b6c117f
rpc: drop unused JSONRPCProcessBatchReply size arg, refactor 2020-05-21 10:24:26 +02:00
Jon Atack
afce85eb99
cli: use GetWalletBalances() functionality for -getinfo
and replace GetBoolArg with IsArgSet as we only want
to know if the arg is passed; we do not need the value.
2020-05-21 10:24:23 +02:00
Jon Atack
9f01849a49
cli: create GetWalletBalances() to fetch multiwallet balances 2020-05-21 10:24:20 +02:00
Jon Atack
743077544b
cli: lift -rpcwallet logic up to CommandLineRPC()
to allow passing rpcwallet independently from the -rpcwallet user option, and to
move the logic to the top-level layer where most of the other option args are
handled.
2020-05-21 10:24:17 +02:00
Jon Atack
29f2cbdeb7
cli: extract connection exception handler, -rpcwait logic
to ConnectAndCallRPC() to be callable for individual connections.

This is needed for RPCs that need to be called and handled sequentially, rather
than alone or in a batch.

For example, when fetching the balances for each loaded wallet, -getinfo will
call RPC listwallets, and then, depending on the result, RPC getbalances.

It may be somewhat helpful to review this commit with `git show -w`.
2020-05-21 10:23:48 +02:00
fanquake
315a4d36f7
build: fix ASLR for bitcoin-cli on Windows
ASLR is not currently working for the bitcoin-cli.exe binary. This is
due to it not having a .reloc section, which is stripped by default by
the mingw-w64 ld we use for gitian builds. A good summary of issues with
ld and mingw-w64 is available in this thread:
https://sourceware.org/bugzilla/show_bug.cgi?id=19011.

All other Windows binaries that we distribute (bitcoind, bitcoin-qt,
bitcoin-wallet, bitcoin-tx and test_bitcoin) do not suffer this issue,
and currently having working ASLR. This is due to them exporting
(inadvertent or not) libsecp256k1 symbols, and, as a result, the .reloc
section is not stripped by ld.

This change is a temporary workaround, also the same one described here:
https://www.kb.cert.org/vuls/id/307144/, that causes main() to be
exported. Exporting a symbol will mean that the .reloc section is not
stripped, and ASLR will function correctly.
2020-04-19 10:05:29 +08:00
MarcoFalke
fa488f131f
scripted-diff: Bump copyright headers
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-
2020-04-16 13:33:09 -04:00
MarcoFalke
4eb1eeb02c
Merge #18504: build: Drop bitcoin-tx and bitcoin-wallet dependencies on libevent
01a3392b1b Drop bitcoin-wallet dependency on libevent (Russell Yanofsky)
0660119ac3 Drop unintended bitcoin-tx dependency on libevent (Russell Yanofsky)

Pull request description:

  This fixes compile errors trying to build bitcoin-tx and bitcoin-wallet without libevent, which were reported by Luke Dashjr in https://github.com/bitcoin/bitcoin/issues/18465

  The fix avoiding `bitcoin-tx` dependency on libevent just adds a conditional build rule. This is implemented in the first commit (more details in commit description).

  The fix avoiding `bitcoin-wallet` dependency on libevent requires minor code changes, because `bitcoin-wallet` (unlike `bitcoin-tx`) links against code that calls `urlDecode` / `evhttp_uridecode`. This fix is implemented in the second commit (again details in the commit description).

ACKs for top commit:
  jonasschnelli:
    utACK 01a3392b1b.

Tree-SHA512: d2245e912ab494cccceeb427a1eca8e55b01a0006ff93eebcfb5461ae7cecd1083ac2de443d9db036b18bdc6f0fb615546caaa20c585046f66d234937f74870a
2020-04-10 12:52:37 -04:00
Jon Atack
75019774c9
cli -getinfo: use getbalances instead of deprecated getwalletinfo balance 2020-04-09 15:42:43 +02:00
Russell Yanofsky
01a3392b1b Drop bitcoin-wallet dependency on libevent
Don't require urlDecode function in wallet code since urlDecode implementation
currently uses libevent. Just call urlDecode indirectly though URL_DECODE
function pointer constant if available.

In bitcoind and bitcoin-qt, URL_DECODE is implemented and used to interpret RPC
wallet requests. In bitcoin-wallet, URL_DECODE is null to avoid depending on
libevent.
2020-04-02 08:35:10 -04:00
MarcoFalke
fa9af06d91
scripted-diff: Replace MilliSleep with UninterruptibleSleep
This is safe because MilliSleep is never executed in a boost::thread,
the only type of thread that is interruptible.

* The RPC server uses std::thread
* The wallet is either executed in an RPC thread or the main thread
* bitcoin-cli, benchmarks and tests are only one thread (the main thread)

-BEGIN VERIFY SCRIPT-
sed -i --regexp-extended -e 's/MilliSleep\((\S+)\);/UninterruptibleSleep(std::chrono::milliseconds{\1});/g' $(git grep -l MilliSleep)
-END VERIFY SCRIPT-
2020-02-21 10:06:21 -08:00
Steven Roose
719662d3f0
Make elements-cli also use DEFAULT chain by default 2020-01-30 17:57:45 +00:00
MarcoFalke
aaaaad6ac9
scripted-diff: Bump copyright of files changed in 2019
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-
2019-12-30 10:42:20 +13:00
malevolent
01c8701559 util: remove unwanted fields from bitcoin-cli -getinfo
In accordance with #17314, Removing noisy fields from -getinfo. Fields removed: protocolversion, walletversion and keypoololdest. In addition to changing bitcoin-cli -getinfo, there is another change to test/functional/interface_bitcoin_cli.py. This change deletes tests that utilize removed -getinfo calls.
2019-12-04 06:48:53 +00:00
fanquake
3d05d33269
cli: fix -getinfo output when compiled with no wallet 2019-11-04 14:39:34 -05:00
Wladimir J. van der Laan
edd9d0781b
Merge #17302: cli: Add "headers" and "verificationprogress" to -getinfo
31879345ee cli: Add "headers" and "verificationprogress" to -getinfo (Wladimir J. van der Laan)

Pull request description:

  These values are useful to know the current progress of initial sync, or of catching up, which is arguably the use of a quick `-getinfo` command.

ACKs for top commit:
  MarcoFalke:
    unsigned ACK 31879345ee
  jonasschnelli:
    utACK 31879345ee
  jonatack:
    Tested ACK 31879345ee on Debian 4.19.37-5+deb10u2 (2019-08-08) x86_64 GNU/Linux

Tree-SHA512: 185180ab426b4db5d99eb208ee88d1606f585361875ba3a92b6c28a74fe181d72ed710c8859b969ba49b1ca7d2385695932b79ff621c7a2a7cedd0df717a99ed
2019-10-30 12:38:31 +01:00