Commit graph

13247 commits

Author SHA1 Message Date
MarcoFalke 8dbb2c5e67
Merge #15680: Remove resendwallettransactions RPC method
ea1a2d8794 [wallet] Remove ResendWalletTransactionsBefore (John Newbery)
f5162458cd [rpc] remove resendwallettransactions RPC (John Newbery)

Pull request description:

  Remove resendwallettransactions RPC method

  This RPC was added for testing wallet rebroadcasts. Since we now have a real test for wallet rebroadcasts, it's no longer needed.

  The call in wallet_basic.py can be removed because wallet_resendwallettransactions.py tests wallet rebroadcast.

ACKs for commit ea1a2d:
  MarcoFalke:
    re-utACK ea1a2d8794
  promag:
    utACK ea1a2d8.

Tree-SHA512: 48245d947be1a2d2b8c30d2946105818c454a03b70b63534ecadf2144da64dafe1c9527ea670a5f4d1acd05ccdfc6c9be43ca636ee2ba58a8b7a7b2fc7bc88fd
2019-04-02 10:30:57 -04:00
MarcoFalke 5a2a9b5b06
Merge #15652: wallet: Update transactions with current mempool after load
4bf1b1cefa qa: Check unconfirmed balance after loadwallet (João Barbosa)
2ebf650b2e wallet: Update transactions with current mempool after load (João Barbosa)
57908a739c interfaces: Add Chain::requestMempoolTransactions (João Barbosa)
0440481c6b wallet: Move CWallet::ReacceptWalletTransactions locks to callers (João Barbosa)

Pull request description:

  Fixes #15591.

ACKs for commit 4bf1b1:
  MarcoFalke:
    re-utACK 4bf1b1cefa
  jnewbery:
    utACK 4bf1b1cefa

Tree-SHA512: 604b1057c7f9fc3772084bf6914e52dd1a68a1cfd365f907e8ec78f6f5f726bc56a3cad9f2b665642714fbf3d51e37c1184ac396460bddeafd918e8f9f7af392
2019-04-01 15:27:02 -04:00
MarcoFalke 35477e9e4e
Merge #15644: Make orphan processing interruptible
866c8058a7 Interrupt orphan processing after every transaction (Pieter Wuille)
6e051f3d32 [MOVEONLY] Move processing of orphan queue to ProcessOrphanTx (Pieter Wuille)
9453018fdc Simplify orphan processing in preparation for interruptibility (Pieter Wuille)

Pull request description:

  As individual orphan transactions can be relatively expensive to handle, it's undesirable to process all of them (max 100) as soon as the parent becomes available, as it pegs the net processing the whole time.

  Change this by interrupting orphan handling after every transactions, and continue in the next processing slot of the peer that gave us the parent - similar to how getdata processing works now. Messages from other peers arriving in the mean time are processed normally, but other messages from the peer that gave us the parent have to wait until all orphan processing is done.

ACKs for commit 866c80:
  sdaftuar:
    ACK 866c8058a7
  MarcoFalke:
    utACK 866c8058a7
  promag:
    utACK 866c805. Verified refactor in 9453018fdc and moved code in 6e051f3d32. Not so sure about change in 866c8058a7 just because I'm not familiar with net processing.

Tree-SHA512: d8e8a1ee5f2999446cdeb8fc9756ed9c24f3d5cd769a7774ec4c317fc8d463fdfceec88de97266f389b715a5dfcc2b0a3abaa573955ea451786cc43b870e8cde
2019-04-01 11:09:40 -04:00
John Newbery ea1a2d8794 [wallet] Remove ResendWalletTransactionsBefore
This is only called from ResendWalletTransactions(), so bring it inline.
2019-04-01 11:07:31 -04:00
João Barbosa 2ebf650b2e wallet: Update transactions with current mempool after load 2019-03-31 11:37:41 +01:00
João Barbosa 57908a739c interfaces: Add Chain::requestMempoolTransactions 2019-03-31 11:37:28 +01:00
MarcoFalke 79c345a011
Merge #15669: rpc: Fix help text for signtransactionwithXXX
afc06fc868 rpc: Fix help text for signtransactionwithXXX (Torkel Rogstad)

Pull request description:

  This PR fixes the help text for the `signrawtransactionwithwallet` and `signrawtransactionwithkey` RPC calls. They both marked the `amount` field in the UTXO dependencies as required. This field is omitted in the [`rpc_rawtransaction.py` test](8a8b03ecd2/test/functional/rpc_rawtransaction.py (L155)) and [`successful_signing_test`](8a8b03ecd2/test/functional/rpc_signrawtransaction.py (L42)) in `rpc_signrawtransaction.py`.

ACKs for commit afc06f:
  promag:
    utACK afc06fc.
  MarcoFalke:
    utACK afc06fc868

Tree-SHA512: 7847844ca38d8033fef2f5255700d21487d78a63ecee8b80362fa28fadfafc80ba29a89f38d7ebb3a1be4c7d47ff6c338f67afec9ee22bf065fb352bb3d03d3a
2019-03-29 18:26:00 -04:00
John Newbery f5162458cd [rpc] remove resendwallettransactions RPC
This RPC was added for testing wallet rebroadcasts. Since we now have a
real test for wallet rebroadcasts, it's no longer needed.

The call in wallet_basic.py can be removed because
wallet_resendwallettransactions.py tests wallet rebroadcast.
2019-03-29 15:06:59 -04:00
MarcoFalke 0baf4b1f96
Merge #15683: Comment for seemingly duplicate LIBBITCOIN_SERVER
2a1408c3ec Comment for seemingly duplicate LIBBITCOIN_SERVER (Peter Bushnell)

Pull request description:

  Added a comment to explain the addition of LIBBITCOIN_SERVER twice in bitcoind_LDADD which seems incorrect at a glance until the behaviour of Linux linkers is understood.

ACKs for commit 2a1408:
  practicalswift:
    ACK 2a1408c3ec
  MarcoFalke:
    ACK 2a1408c
  fanquake:
    utACK 2a1408c
  ryanofsky:
    utACK 2a1408c3ec

Tree-SHA512: dd2a7f61d53ce8882a56c831c32e1f48e9eab741ef21361f195c38bb455abdc4bc524d3b44b6f69c7498898cd871a23c39d215de28db3b20ef5fd2135d5e136a
2019-03-29 13:21:24 -04:00
Jonas Schnelli edc68d40e9
Merge #15663: crypto: Remove unused AES-128 code
f6ee177f7 Remove unused AES-128 code (practicalswift)

Pull request description:

  Remove unused AES-128 code.

  As far as I can tell this AES-128 code has never been in use in the project (outside of testing/benchmarking).

  The AES-256 code is used in `CCrypter::Encrypt`/`CCrypter::Decrypt` (`src/wallet/crypter.cpp`).

  Trivia: 0.15% of the project's C++ LOC count (excluding dependencies) is trimmed off:

  ```
  $ LOC_BEFORE=$(git grep -I "" HEAD~1 -- "*.cpp" "*.h" ":(exclude)src/leveldb/" ":(exclude)src/secp256k1/" ":(exclude)src/univalue/" | wc -l)
  $ LOC_AFTER=$(git grep -I "" -- "*.cpp" "*.h" ":(exclude)src/leveldb/" ":(exclude)src/secp256k1/" ":(exclude)src/univalue/" | wc -l)
  $ bc <<< "scale=4; ${LOC_AFTER}/${LOC_BEFORE}"
  .9985
  ```

  :-)

Tree-SHA512: 9588a3cd795a89ef658b8ee7323865f57723cb4ed9560c21de793f82d35e2835059e7d6d0705e99e3d16bf6b2a444b4bf19568d50174ff3776caf8a3168f5c85
2019-03-29 10:22:24 +01:00
Peter Bushnell 2a1408c3ec Comment for seemingly duplicate LIBBITCOIN_SERVER 2019-03-28 15:31:42 +00:00
MarcoFalke 9e7dc682e0
Merge #15616: rpc: Clarify decodescript RPCResult doc
fa926ec24f rpc: Mention all output types in decodescript doc (MarcoFalke)
fa3caa1666 rpc: decodescript use IsValidNumArgs over hardcoded check (MarcoFalke)
faad33ff15 rpc: Clarify decodescript RPCResult doc (MarcoFalke)

Pull request description:

  * Remove `"hex"` from the decodescript RPCResult doc
  * Add `"segwit`" to the doc

  Follow up to a6099ef319 and 4f933b3d23

ACKs for commit fa926e:
  ryanofsky:
    utACK fa926ec24f. Only change since last review is listing possible output types in the help string using a new `GetAllOutputTypes` function

Tree-SHA512: e6ecc563d04769942567118d50188467bf64ceb276ba6268928d469e8f06621f2ca1ae1e555d3daa6ec22a615ee259bb31c4141c19818d0f53fb6c529b18381b
2019-03-28 10:56:56 -04:00
Torkel Rogstad afc06fc868 rpc: Fix help text for signtransactionwithXXX 2019-03-28 08:54:37 +01:00
João Barbosa 0440481c6b wallet: Move CWallet::ReacceptWalletTransactions locks to callers 2019-03-27 16:59:47 +00:00
MarcoFalke 656a15e539
Merge #15620: rpc: Uncouple non-wallet rpcs from maxTxFee global
fa1ad200d3 doc: Add release notes for 15620 (MarcoFalke)
fa96d76421 rpc: Uncouple rpcs from maxTxFee global (MarcoFalke)
fa965e03c7 rpc: Use IsValidNumArgs over hardcoded size checks (MarcoFalke)

Pull request description:

  This makes the rpcs a bit more stateless by falling back to their own default max fee instead of the global maxTxFee.

  A follow up pull request will move `-maxtxfee` to the wallet.

  See also related discussions:

  * `-maxtxfee` should not be used by both node and wallet #15355
  *  [RFC] Long term plan for wallet command-line args #13044

ACKs for commit fa1ad2:
  jnewbery:
    utACK fa1ad200d3
  Empact:
    utACK fa1ad200d3
  jnewbery:
    utACK fa1ad200d3
  promag:
    utACK fa1ad20.

Tree-SHA512: c9cf0b54cd30ff3ab0d090b072cc38fcbb2840bc6ad9a9711995333bc927d2500aece6b5a60e061666eca5ed72b70aa318d21e51eb15ee0106b41f5b6e4e1adf
2019-03-27 09:01:53 -04:00
Wladimir J. van der Laan 208406038c
Merge #15519: Add Poly1305 implementation
e9d5e97561 Poly1305: tolerate the intentional unsigned wraparound in poly1305.cpp (Jonas Schnelli)
b34bf302f2 Add Poly1305 bench (Jonas Schnelli)
03be7f48fa Add Poly1305 implementation (Jonas Schnelli)

Pull request description:

  This adds a currently unused Poly1305 implementation including test vectors from RFC7539.

  Required for BIP151 (and related to #15512).

Tree-SHA512: f8c1ad2f686b980a7498ca50c517e2348ac7b1fe550565156f6c2b20faf764978e4fa6b5b1c3777a16e7a12e2eca3fb57a59be9c788b00d4358ee80f2959edb1
2019-03-27 11:53:15 +01:00
Jonas Schnelli b34bf302f2
Add Poly1305 bench 2019-03-26 18:12:31 +01:00
Jonas Schnelli 03be7f48fa
Add Poly1305 implementation 2019-03-26 18:12:29 +01:00
practicalswift f6ee177f7d Remove unused AES-128 code 2019-03-25 14:46:30 +01:00
Miguel Herranz e16b6a7188
rpc: Rename size to vsize in mempool related calls 2019-03-24 12:01:43 +08:00
Pieter Wuille 866c8058a7 Interrupt orphan processing after every transaction
This makes orphan processing work like handling getdata messages:
After every actual transaction validation attempt, interrupt
processing to deal with messages arriving from other peers.
2019-03-22 19:25:50 -07:00
Pieter Wuille 6e051f3d32 [MOVEONLY] Move processing of orphan queue to ProcessOrphanTx 2019-03-22 19:21:58 -07:00
Pieter Wuille 9453018fdc Simplify orphan processing in preparation for interruptibility 2019-03-22 19:10:22 -07:00
John Newbery 7b6616b78b [rpc] Remove deprecated functionality message from validateaddress help
This functionality was removed in v0.18.
2019-03-22 10:30:25 -04:00
John Newbery 839c3f7c49 [rpc] Remove signrawtransaction warning
signrawtransaction was deprecated in 0.17 and removed in 0.18. A warning
was left in place to tell users to migrate to using
signrawtransactionswithwallet or signrawtransactionwithkey. Remove the
warning now that it's been two releases since the method was removed.
2019-03-22 10:30:25 -04:00
João Barbosa a10972bc03 gui: Defer removeAndDeleteWallet when no modal widget is active 2019-03-22 09:51:04 +00:00
MeshCollider 717fd58c4b
Merge #15625: refactor: Remove unused function
bb6195e34 refactor: Remove unused function (practicalswift)

Pull request description:

  Last use removed in cad5dd2368.

Tree-SHA512: f65bf8f77b9aadbfba39bd80076a4d773eddf685a8a90ef2db549552a3d0ccd426ce3920b2f71954703f64d840fa88349957996d1f64a9c4d3f27a99b4da70e7
2019-03-21 21:00:25 +13:00
MeshCollider 2607d960a0
Merge #10973: Refactor: separate wallet from node
d358466de Remove remaining wallet accesses to node globals (Russell Yanofsky)
b1b2b2389 Remove use of CCoinsViewMemPool::GetCoin in wallet code (Russell Yanofsky)
4e4d9e9f8 Remove use of CRPCTable::appendCommand in wallet code (Russell Yanofsky)
91868e628 Remove use CValidationInterface in wallet code (Russell Yanofsky)

Pull request description:

  This PR is the last in a chain of PRs (#14437, #14711, and #15288) that make the wallet code access node state through an abstract [`Chain`](https://github.com/ryanofsky/bitcoin/blob/pr/wipc-sep/src/interfaces/chain.h) class in [`src/interfaces/`](https://github.com/ryanofsky/bitcoin/tree/pr/wipc-sep/src/interfaces) instead of using global variables like `cs_main`, `chainActive`, and `g_connman`. After this PR, wallet code no longer accesses global variables declared outside the wallet directory, and no longer calls functions accessing those globals (as verified by the `hide-globals` script in #10244).

  This PR and the previous PRs have been refactoring changes that do not affect behavior. Previous PRs have consisted of lots of mechanical changes like:

  ```diff
  -    wtx.nTimeReceived = GetAdjustedTime();
  +    wtx.nTimeReceived = m_chain->getAdjustedTime();
  ```

  This PR is smaller, but less mechanical. It replaces last few bits of wallet code that access node state directly (through `CValidationInterface`, `CRPCTable`, and `CCoinsViewMemPool` interfaces) with code that uses the `Chain` interface.

  These changes allow followup PR #10102 (multiprocess gui & wallet PR) to work without any significant updates to wallet code. Additionally they:

  * Provide a single place to describe the interface between wallet and node code.
  * Can make better wallet testing possible, because the `Chain` object consists of virtual methods that can be overloaded for mocking. (This could be used to test edge cases in the rescan code, for example).

Tree-SHA512: e6291d8a3c50bdff18a9c8ad11e729beb30b5b7040d7aaf31ba678800b4a97b2dd2be76340b1e5c01fe2827d67d37ed1bb4c8380cf8ed653aadfea003e9b22e7
2019-03-21 20:58:43 +13:00
Wladimir J. van der Laan b3f82284ba
Merge #15597: net: Generate log entry when blocks messages are received unexpectedly
ef0019e054 Generate log entry when blocks messages are received unexpectedly. (Patrick Strateman)

Pull request description:

  Currently these are incorrectly logged as an unknown command.

Tree-SHA512: dd272388a90b79897f8c1ea6d4c949323fcf75493f3a5b2ec9a26a2cf6a8ee743b497941702f21df8fae0f5b9481444363643379832dbd5053b0cc0b0363de04
2019-03-20 20:36:25 +01:00
MarcoFalke 93623eea71
Merge #15623: refactor: Expose UndoReadFromDisk in header
fa11c036e9 refactor: Expose UndoReadFromDisk in header (MarcoFalke)

Pull request description:

  It is not possible to calculate the fee of a non-mempool transaction in RPCs unless txindex is active or the prevtxs are passed in through the RPC.

  Fix that issue for confirmed txs by exposing `UndoReadFromDisk` in the header file.

  This pull is a requirement for
  * rpc: faster getblockstats using BlockUndo data #14802
  *  Index for BIP 157 block filters #14121
  * my local patches

Tree-SHA512: 859ea5f2dfb4feac612b50faeb0e2b6c07b83f1d983e519d7647a78058d85c0390fd09ec66b460ae7a4c3b273e81b0013ee9f4bb8dfba0c4782ffaa1fa453ea6
2019-03-20 12:28:18 -04:00
Wladimir J. van der Laan 81f732bcaa
Merge #15617: p2p: Do not relay banned IP addresses
054d01d0a8 Do not relay banned IP addresses (Pieter Wuille)

Pull request description:

Tree-SHA512: 538c43781c789949e1ae566533e76835d478e40e8ba6427b22234ee611cb4a311b2940a214e37c1e9c9afe28a6814a00d490a39e3580bb5ebd85b03e95040246
2019-03-20 11:38:08 +01:00
practicalswift bb6195e34d refactor: Remove unused function 2019-03-20 10:51:15 +01:00
MarcoFalke fa1ad200d3
doc: Add release notes for 15620 2019-03-19 17:06:43 -04:00
MarcoFalke fa926ec24f
rpc: Mention all output types in decodescript doc 2019-03-19 15:54:39 -04:00
MarcoFalke fa11c036e9
refactor: Expose UndoReadFromDisk in header 2019-03-19 14:20:43 -04:00
Wladimir J. van der Laan e45b7f20e6
Merge #15618: refactor: Remove unused function
fa5c511a83 refactor: Remove unused function (MarcoFalke)

Pull request description:

  Oversight of kallewoof and mine in https://github.com/bitcoin/bitcoin/pull/13541#discussion_r266555476

Tree-SHA512: 2fd3c4ecde5d3c58b113aa58d606976ceb4998358bde0547ead8e83df210722fa9821d2c88b717bdd190ef71593cd9c0154c3a5d3f2ccc3af8cbf6c36aaa6d45
2019-03-18 20:06:11 +01:00
MarcoFalke fa96d76421
rpc: Uncouple rpcs from maxTxFee global 2019-03-18 13:56:56 -04:00
MarcoFalke fa965e03c7
rpc: Use IsValidNumArgs over hardcoded size checks 2019-03-18 13:55:19 -04:00
MarcoFalke fa5c511a83
refactor: Remove unused function 2019-03-18 13:30:55 -04:00
MarcoFalke c033c4b5ce
Merge #13541: wallet/rpc: sendrawtransaction maxfeerate
7abd2e697c wallet/rpc: add maxfeerate parameter to testmempoolaccept (Karl-Johan Alm)
6c0a6f73e3 wallet/rpc: add maxfeerate parameter to sendrawtransaction (Karl-Johan Alm)
e5efacb941 test: Refactor vout fetches in rpc_rawtransaction (Karl-Johan Alm)

Pull request description:

  This adds a new `maxfeerate` parameter to `sendrawtransaction` which forces the node to reject a transaction whose feerate is above the given fee rate.

  This is a safety harness from shooting yourself in the foot and accidentally overpaying fees.

  See also #12911.

Tree-SHA512: efa50134a7c17c9330cfdfd48ba400e095c0a419cc45e630618d8b44929c25d780d1bb2710c1fbbb6e687eca373505b0338cdaa7f2ff4ca22636d84c31557a2e
2019-03-18 13:22:15 -04:00
Carl Dong 340ef50772 depends: Defer to Python detected by autoconf
Since autoconf already detects the correct python binary path, we should
use that instead of going around it. Also has the benefit of working in
extremely restricted environments where /usr/bin/env might not be
available.
2019-03-18 11:05:17 -04:00
MeshCollider 7ec7aea442
Merge #15491: wallet: Improve log output for errors during load
faf369880 wallet: Improve log output for errors during load (Glenn Willen)

Pull request description:

  When loading the wallet, display the entire path in error messages, instead of
  the name (which, for the default wallet, is the empty string.)

  When an exception occurs during wallet loading, display e.what() if possible,
  instead of nothing.

Tree-SHA512: 435247628db669579bb694ba4b53ba174fe42c0329fc72f09fc274bb28463ee69f53412abb2a3b45bb8f59f7eb928c0167e397b8d0a514135142192a87294614
2019-03-18 20:34:55 +13:00
Pieter Wuille 054d01d0a8 Do not relay banned IP addresses 2019-03-17 22:05:49 -07:00
MarcoFalke fa3caa1666
rpc: decodescript use IsValidNumArgs over hardcoded check 2019-03-17 22:52:18 -04:00
MarcoFalke faad33ff15
rpc: Clarify decodescript RPCResult doc 2019-03-17 22:51:33 -04:00
Wladimir J. van der Laan 2f501fb5c6
Merge #15522: Document sizeof(size_t) assumptions and compiler assumptions in assumptions.h
c7a7250302 Document assumptions about C++ compiler (practicalswift)
c7ea8d3236 Add sizeof(size_t) assumptions (practicalswift)

Pull request description:

  Document `sizeof(size_t)` assumptions and compiler assumptions by adding compile-time checks in `assumptions.h`.

Tree-SHA512: db46481eecad6a87718ae637a7761d39d32cfe6f95fc8ad2b3a52a3d966c2a05c8f540dd3f362721279816571b04b6cce2de9b3b1d17606d7b197126cd4a8d1f
2019-03-16 17:11:14 +01:00
Glenn Willen faf3698808 wallet: Improve log output for errors during load
When loading the wallet, display the entire path in error messages, instead of
the name (which, for the default wallet, is the empty string.)

When an exception occurs during wallet loading, display e.what() if possible,
instead of nothing.
2019-03-14 18:49:19 -07:00
Wladimir J. van der Laan 7fa1f6258c
Merge #15583: wallet: Log and ignore errors in ListWalletDir and IsBerkeleyBtree
15c69b158d wallet: Log and ignore errors in ListWalletDir and IsBerkeleyBtree (João Barbosa)

Pull request description:

  Use the `noexcept` members of `boost::filesystem::recursive_directory_iterator` in order to ignore `boost::filesystem::directory_iterator::construct: Permission denied` errors. The errors are logged though.

  Steps to reproduce the issue:

  ```sh
  # 1. create directory for -walletdir without read access:
  mkdir /tmp/foo && chmod a-r /tmp/foo

  # 2. run bitcoin-qt and should print an error, but continues running:
  /Volumes/Bitcoin-Core/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt -regtest -walletdir=/tmp/foo
  /private/tmp/foo: Permission denied

  # 4. go to File -> Open Wallet and should segfault:
  EXCEPTION: N5boost10filesystem16filesystem_errorE
  boost::filesystem::directory_iterator::construct: Permission denied: "/private/tmp/foo"
  bitcoin in Runaway exception
  ```

Tree-SHA512: 37e8bf5a1e0defc331030fd511bf9cac2765d01dfbf23e7233f37506e85b8ad07edcde9ba6dae7a2c95700c78d28c7dd248153607381852da96273cb159c4934
2019-03-14 18:58:43 +01:00
Patrick Strateman ef0019e054 Generate log entry when blocks messages are received unexpectedly. 2019-03-13 21:05:15 -04:00
Karl-Johan Alm 6c0a6f73e3
wallet/rpc: add maxfeerate parameter to sendrawtransaction 2019-03-14 08:48:46 +09:00