Commit graph

23255 commits

Author SHA1 Message Date
Ben Woosley
1891245e73
refactor: Cast ping values to double before output
Note the divisor is a floating point literal so presumably
also floating point.
2020-03-05 04:44:50 -05:00
fanquake
cbc32d67dc
Merge #18249: test: Bump timeouts to accomodate really slow disks
fa6df0de53 test: Bump timeouts to accomodate really slow disks (MarcoFalke)

Pull request description:

  Needed these patches locally for some arm machines with slow storage

ACKs for top commit:
  practicalswift:
    ACK fa6df0de53
  fanquake:
    ACK fa6df0de53

Tree-SHA512: 22f2f6f7ed05f26013431126bb179b029dbc931f02d0e58f8970c6d477f43e3106d76c9732942034cb2cfcb827191e338a082f953ccb69531a19ee6dab9a7e1a
2020-03-05 15:06:52 +08:00
fanquake
2492dc0068
Merge #18259: doc: Merge release notes for 0.20.0 release
fa8b6020ec doc: Merge release notes for 0.20.0 release (MarcoFalke)

Pull request description:

  mostly move-only. Can be reviewed with the `--color-moved=dimmed-zebra` option.

ACKs for top commit:
  laanwj:
    ACK fa8b6020ec
  fanquake:
    ACK fa8b6020ec - any changes are basically headers and newlines.

Tree-SHA512: 7273c7625d60c3b28bafc4371e17545bd9fcaa672fde8492a0b4ab88081d616dd41c77389d18a9a3b39b595c5409a354bf511745ddcb9834c9a25d91b94edb28
2020-03-05 10:25:39 +08:00
Ben Woosley
7a810b1d7a
refactor: Convert ping wait time from double to int64_t 2020-03-04 13:45:29 -05:00
Ben Woosley
e6fc63ec7e
refactor: Convert min ping time from double to int64_t 2020-03-04 13:44:57 -05:00
Ben Woosley
b054c46977
refactor: Convert ping time from double to int64_t 2020-03-04 13:44:25 -05:00
MarcoFalke
fa8b6020ec
doc: Merge release notes for 0.20.0 release 2020-03-04 10:06:23 -05:00
Jon Atack
1ba3e1cc21
init: move asmap code earlier in init process
and update feature_asmap.py and test_runner.py

This commit moves the asmap init.cpp code from the end of "Step 12: start node"
to "Step 6: network initialization" to provide feedback on passing an -asmap
config arg much more quickly. This change speeds up the feature_asmap.py
functional test file from 60 to 5 seconds by accelerating the 2 tests that use
`assert_start_raises_init_error`.

Credit to Wladimir J. van der Laan for the suggestion.
2020-03-04 14:54:30 +01:00
Jon Atack
5ba829e12e
rpc: fix getpeerinfo RPCResult mapped_as type
and mention it is only available if the asmap config flag is set.
2020-03-04 14:54:27 +01:00
Jon Atack
c90b9a2399
net: extract conditional to bool CNetAddr::IsHeNet
and remove redundant public declaration
2020-03-04 14:31:31 +01:00
Jon Atack
819fb5549b
logging: asmap logging and #include fixups
- move asmap #includes to sorted positions in addrman and init (move-only)

- remove redundant quotes in asmap InitError, update test

- remove full stops from asmap logging to be consistent with debug logging,
  update tests
2020-03-04 14:24:19 +01:00
Jon Atack
dcaf543ba0
test: add functional test for an empty, unparsable asmap
This is now testable after separating the asmap finding and parsing checks in
the previous commit.
2020-03-04 14:24:17 +01:00
Jon Atack
b8d0412b21
config: separate the asmap finding and parsing checks
and update the tests.
2020-03-04 14:24:15 +01:00
Jon Atack
81c38a2497
config: enable passing -asmap an absolute file path
- allow passing an absolute file path to the -asmap config arg

- update the -asmap config help

- add a functional test in feature_asmap.py
2020-03-04 14:24:13 +01:00
Jon Atack
fbe9b024f0
config: use default value in -asmap config
and move to sorted position
2020-03-04 14:24:11 +01:00
Jon Atack
08b992675c
test: add feature_asmap functional tests
to verify node behaviour and debug log when launching bitcoind in these cases:

1. `bitcoind` with no -asmap arg, using /16 prefix for IP bucketing

2. `bitcoind -asmap=<relative path>`, using the unit test skeleton asmap

3. `bitcoind -asmap/-asmap=` with no file specified, using the default asmap

4. `bitcoind -asmap` with no file specified, and a missing default asmap file

The tests are order-independent. The slowest test (missing default asmap file)
is placed last.
2020-03-04 14:24:08 +01:00
MarcoFalke
a71c34742c
Merge #17809: rpc: Auto-format RPCResult
fa6b061fc1 rpc: Auto-format RPCResult (MarcoFalke)
fa7d0503d3 rpc: Move OuterType enum to header (MarcoFalke)

Pull request description:

  This enforces most syntax rules of the RPCResult at compile time (or some at run time during unit and functional tests)

  Apart from normalizing the syntax, by separating stylistic formatting from the structure, we could in theory directly generate the html for e.g. https://bitcoincore.org/en/doc/0.19.0/rpc/wallet/importmulti/

ACKs for top commit:
  Sjors:
    Indeed, re-ACK fa6b061fc1
  ajtowns:
    ACK fa6b061fc1 -- skimmed code changes and differences to rpc help output

Tree-SHA512: 5b510b3aa0b7c7b9189a48c77593159409069f939145b9a00c5478e894cf65f994d44d633eb7bb7dbea40ee820645a2930976c24772379d96929002b120efa28
2020-03-04 08:16:57 -05:00
fanquake
088604221b
Merge #18253: doc: Correct spelling errors in comments
9b0e16226e doc: Correct spelling errors in comments (Ben Woosley)

Pull request description:

  And ci script output.

  Identified via test/lint/lint-spelling

  Before:
  ```
  $ test/lint/lint-spelling.sh
  ci/test/05_before_script.sh:29: explicitely  ==> explicitly
  src/compressor.h:43: Ser  ==> Set
  src/compressor.h:78: Ser  ==> Set
  src/logging/timer.h:88: outputing  ==> outputting
  src/node/psbt.cpp:87: minumum  ==> minimum
  src/qt/coincontroldialog.cpp:372: UnSelect  ==> deselect
  src/qt/coincontroldialog.cpp:443: unselect  ==> deselect
  src/qt/coincontroldialog.cpp:448: UnSelect  ==> deselect
  src/qt/coincontroldialog.cpp:699: UnSelect  ==> deselect
  src/serialize.h:211: Ser  ==> Set
  src/serialize.h:213: Ser  ==> Set
  src/serialize.h:228: Ser  ==> Set
  src/serialize.h:246: Ser  ==> Set
  src/serialize.h:484: Ser  ==> Set
  src/serialize.h:490: Ser  ==> Set
  src/serialize.h:510: Ser  ==> Set
  src/serialize.h:622: Ser  ==> Set
  src/serialize.h:740: Ser  ==> Set
  src/test/base32_tests.cpp:14: fo  ==> of, for
  src/test/base64_tests.cpp:14: fo  ==> of, for
  src/txmempool.h:756: incomaptible  ==> incompatible
  src/undo.h:26: Ser  ==> Set
  src/wallet/coincontrol.h:74: UnSelect  ==> deselect
  test/functional/feature_backwards_compatibility.py:116: Abondon  ==> Abandon
  test/functional/rpc_getaddressinfo_label_deprecation.py:7: superceded  ==> superseded
  test/lint/lint-shell.sh:44: desriptor  ==> descriptor
  ^ Warning: codespell identified likely spelling errors. Any false positives? Add them to the list of ignored words in test/lint/lint-spelling.ignore-words.txt
  ```

  After:
  ```
  $ test/lint/lint-spelling.sh
  src/test/base32_tests.cpp:14: fo  ==> of, for
  src/test/base64_tests.cpp:14: fo  ==> of, for
  test/functional/rpc_getaddressinfo_label_deprecation.py:7: superceded  ==> superseded
  ^ Warning: codespell identified likely spelling errors. Any false positives? Add them to the list of ignored words in test/lint/lint-spelling.ignore-words.txt
  ```

ACKs for top commit:
  practicalswift:
    ACK 9b0e16226e
  MarcoFalke:
    ACK 9b0e16226e

Tree-SHA512: 9ce203700b11596e4b920b3c5b04f59bc7784fe5b495868d43423608180a9a553ec7efcc5ad70384f3ce462b036c2a682260efebce493c5e6a3d48716b268179
2020-03-04 12:22:17 +08:00
MarcoFalke
faae5a9a35
test: Add bad-txns-*-toolarge test cases to invalid_txs 2020-03-03 12:42:52 -05:00
Ben Woosley
9b0e16226e
doc: Correct spelling errors in comments
And ci script output.

Identified via test/lint/lint-spelling
2020-03-02 23:07:21 -08:00
MarcoFalke
fa6df0de53
test: Bump timeouts to accomodate really slow disks 2020-03-02 16:25:05 -05:00
Wladimir J. van der Laan
ac5c5d0162
Merge #18168: httpserver: use own HTTP status codes
aff2748f8a httpserver: use own HTTP status codes (Filip Gospodinov)

Pull request description:

  Before, macros defined in `<event2/http.h>` have been used for some HTTP status codes. `<event2/http.h>` is included implicitly and the usage of its status code macros is inconsistent with the majority HTTP response implementations in this file.

  Now, the `HTTPStatusCode` enum from `<rpc/protocol.h>` is consistently used for all HTTP response implementations.

ACKs for top commit:
  practicalswift:
    ACK aff2748f8a -- patch looks correct
  laanwj:
    ACK aff2748f8a

Tree-SHA512: 6a7043488b88dcd584215d16b5f16f7bd668fe5553d31298d1beef134d2b0648aef81533014e34d1cd600baa36ee4e853f195352f4a00c866bd5ab1ff688bd50
2020-03-02 17:10:55 +01:00
Samuel Dobson
1f886243e4
Merge #18224: Make AnalyzePSBT next role calculation simple, correct
1ef28b4f7c Make AnalyzePSBT next role calculation simple, correct (Gregory Sanders)

Pull request description:

  Sniped test and alternative to https://github.com/bitcoin/bitcoin/pull/18220

  Sjors documenting the issue:
  ```
  A PSBT signed by ColdCard was analyzed as follows (see #17509 (comment))

  {
    "inputs": [
      {
        "has_utxo": true,
        "is_final": false,
        "next": "finalizer"
      }
    ],
    "estimated_vsize": 141,
    "estimated_feerate": 1e-05,
    "fee": 1.41e-06,
    "next": "signer"
  }
  I changed AnalyzePSBT so that it returns "next": "finalizer" instead.
  ```

  It makes it much clearer that the role has been decided before hitting the `calc_fee` block, and groups all state-deciding in one spot instead of 2.

  Note that this assumes that PSBT roles are a complete ordering, which for now and in the future seems to be a correct assumption.

ACKs for top commit:
  Sjors:
    ACK 1ef28b4f7c, much nicer. Don't forget to document the bug fix.
  achow101:
    ACK 1ef28b4f7c
  Empact:
    ACK 1ef28b4f7c

Tree-SHA512: 22ba4234985c6f9c1445b14565c71268cfaa121c4ef000ee3d5117212b09442dee8d46d9701bceddaf355263fe25dfe40def2ef614d4f2fe66c9ce876cb49934
2020-03-02 22:47:59 +13:00
Karl-Johan Alm
79facb11e9
wallet: use constant CWallets in rpcwallet.cpp
* GetAvoidReuseFlag: simply gets the flag, without modifying the wallet
* ListReceived: helper function to produce lists
* ListTransactions: produces a list of transactions, without modifications; two cases of map [] -> .at() for verified-existing keys
* DescribeWalletAddress: generates a description of a given wallet address without changing the wallet
* The following functions produce a list without making any modifications to the wallet:
  * listaddressgroupings
  * listreceivedbyaddress
  * listreceivedbylabel
  * listtransactions
  * listsinceblock
  * listlockunspent
  * listunspent
  * listlabels
  * getreceivedbyaddress
  * getreceivedbylabel
  * getaddressesbylabel
* signmessage: uses the wallet to procure a private key for signing, but does no modifications
* getbalance, getunconfirmedbalance: calculates the wallet balance, without any modifications
* gettransaction: procures transaction without any modifications
* backupwallet: makes a backup of the wallet to disk, without changing said wallet
* getwalletinfo: produces info about wallet without any modifications
* signrawtransactionwithwallet: modifies incoming transaction on the fly by signing with private key procured from within wallet; no modifications to wallet
* getaddressinfo: gets information about the given address, with no modifications done to the wallet; one case of [] -> .at() and one ::iterator -> ::const_iterator
* walletprocesspsbt: processes the given PSBT on the fly, without modifying the wallet
2020-03-02 17:27:36 +09:00
Karl-Johan Alm
d9b0ebc1da
wallet: make ReserveDestination pwallet ivar const 2020-03-02 17:27:35 +09:00
Karl-Johan Alm
57c569e4d9
wallet: make BackupWallet() const 2020-03-02 17:27:35 +09:00
Karl-Johan Alm
df3a818d2a
wallet: make getters const 2020-03-02 17:27:35 +09:00
Karl-Johan Alm
227b9dd2d6
wallet/spkm: make GetOldestKeyPoolTime() const
The method checks the oldest key time for key pools and returns the oldest. It does no modifications.
2020-03-02 17:26:31 +09:00
Karl-Johan Alm
22d329ad0e
wallet: use constant CWallets in rpcdump.cpp
* GetWalletAddressesForKey is, as the name implies, immutable; the one change besides the parameter constness is a [] -> .at() change, to a verified-existing key.
* dumpprivkey and dumpwallet are both similarly immutable, for obvious reasons.
2020-03-02 17:26:30 +09:00
Karl-Johan Alm
7b3587b29d
wallet/db: make IsDummy() const
This method does a simple check and no modifications.
2020-03-02 17:26:30 +09:00
Karl-Johan Alm
d366795d18
wallet/db: make Backup() const
This method is the to-disk equivalent of serialize methods which are also const.
2020-03-02 17:26:30 +09:00
Karl-Johan Alm
8cd0b86340
wallet: make CanGetAddresses() const
CWallet::CanGetAddresses() is used to check whether the wallet has available or is able to produce keys for addresses. It uses the ScriptPubKeyMan::CanGetAddresses(), which in turn uses the const KeypoolCountExternalKeys() method, all which do counting and no modifications.
2020-03-02 17:26:30 +09:00
Karl-Johan Alm
037fa770eb
wallet: make KeypoolCountExternalKeys() const
This method returns the sum of the key pool sizes. It does no modification.
2020-03-02 17:26:30 +09:00
Karl-Johan Alm
ddc93557ad
wallet: make CanGenerateKeys() const
This method simply checks if HD is or can be enabled and does not require mutability.
2020-03-02 17:26:30 +09:00
Karl-Johan Alm
dc2d0650fd
make BlockUntilSyncedToCurrentChain() const
The method checks the chain tip for the best block, and calls SyncWithValidationInterfaceQueue() (a standalone function) if necessary.
2020-03-02 17:26:30 +09:00
MarcoFalke
54a7ef612a
Merge #17399: validation: Templatize ValidationState instead of subclassing
10efc0487c Templatize ValidationState instead of subclassing (Jeffrey Czyz)
10e85d4adc Remove ValidationState's constructor (Jeffrey Czyz)
0aed17ef28 Refactor FormatStateMessage into ValidationState (Jeffrey Czyz)

Pull request description:

  This removes boilerplate code in the subclasses which otherwise only
  differ by the result type.

  The subclassing was introduced in a27a295.

ACKs for top commit:
  MarcoFalke:
    ACK 10efc0487c 🐱
  ajtowns:
    ACK 10efc0487c -- looks good to me
  jonatack:
    ACK 10efc048 code review, build/tests green, nice cleanup

Tree-SHA512: 765dd52dde7d49b9a5c6d99d97c96f4492673e2aed0b0604faa88db0308fa4500a26bf755cca0b896be283874096c215932e1110a2d01dc012cd36a5fce58a42
2020-03-01 15:34:05 -05:00
Yusuf Sahin HAMZA
3e32499909
Change example addresses to bech32 2020-03-01 18:13:35 +03:00
fanquake
715dbbe9e8
Merge #18229: random: drop unused MACH time headers
d36146009f Drop unused mach time headers (Ben Woosley)

Pull request description:

  Now that we're no longer special-casing clock usage for MacOS (see #17800), we're
  not referencing anything defined in these headers.

  Incidentally, this removes our last reference to the `__MACH__` system def. 🎉

ACKs for top commit:
  jonasschnelli:
    utACK d36146009f
  fanquake:
    ACK d36146009f - thanks.

Tree-SHA512: 246045b0683a705ad034416e8ace2024e652026a6c0517b6797320e52fc18a6e111ec2e405ca40653bd1d6421bb7755232e8fec22651fff8e448eb7d5646a954
2020-02-29 18:08:11 +08:00
fanquake
9027960932
Merge #18225: util: Fail to parse empty string in ParseMoney
8888461f68 util: Fail to parse empty string in ParseMoney (MarcoFalke)
fab30b61eb util: Remove unused ParseMoney that takes a c_str (MarcoFalke)

Pull request description:

  Supplying a fee rate or an amount on the command line as an empty string, which currently parses as `0` seems fragile and confusing. See for example the confusion in #18214.

  Fixes #18214

ACKs for top commit:
  Empact:
    Code Review ACK 8888461f68
  achow101:
    ACK 8888461f68
  instagibbs:
    utACK 8888461f68

Tree-SHA512: ac2d6b7fa89fe5809c34d5f49831042032591c34fb3c76908d72fed51e8bced41bf2b41dc1b3be34ee691a40463355649857a7a8f378709d38ae89503feb11c2
2020-02-29 09:44:48 +08:00
Ben Woosley
d36146009f
Drop unused mach time headers
Now that we're no longer special-casing clock usage for MacOS, we're
not referencing anything defined in these headers.
2020-02-28 14:56:49 -08:00
MarcoFalke
eca4d8ef6a
Merge #16562: Refactor message transport packaging
16d6113f4f Refactor message transport packaging (Jonas Schnelli)

Pull request description:

  This PR factors out transport packaging logic from `CConnman::PushMessage()`.
  It's similar to #16202 (where we refactor deserialization).

  This allows implementing a new message transport protocol like BIP324.

ACKs for top commit:
  dongcarl:
    ACK 16d6113f4f FWIW
  ariard:
    Code review ACK 16d6113
  elichai:
    semiACK 16d6113f4f ran functional+unit tests.
  MarcoFalke:
    ACK 16d6113f4f 🙎

Tree-SHA512: 8c2f8ab9f52e9b94327973ae15019a08109d5d9f9247492703a842827c5b5d634fc0411759e0bb316d824c586614b0220c2006410851933613bc143e58f7e6c1
2020-02-28 17:01:58 -05:00
Wladimir J. van der Laan
1a51cd1ac5
Merge #17800: random: don't special case clock usage on macOS
dc9305b616 random: don't special case clock usage on macOS (fanquake)

Pull request description:

  `clock_gettime()`, `CLOCK_MONOTONIC` and `CLOCK_REALTIME` are all available for use on
  macOS (now that we require macOS >=10.12 and build against 10.14). Use them rather than the [deprecated](https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/KernelProgramming/Mach/Mach.html) `mach_timespec_t` time API.

  I mentioned the possibility for this change [in #17270](https://github.com/bitcoin/bitcoin/pull/17270#discussion_r346090606).

  [master](1dbf3350c6):
  ```bash
  2019-12-23T20:49:43Z Feeding 216 bytes of dynamic environment data into RNG
  2019-12-23T20:50:43Z Feeding 216 bytes of dynamic environment data into RNG
  ```

  This PR:
  ```bash
  2019-12-23T20:32:41Z Feeding 232 bytes of dynamic environment data into RNG
  2019-12-23T20:33:42Z Feeding 232 bytes of dynamic environment data into RNG
  ```

  ~~Depends on #16392.~~ Merged.

ACKs for top commit:
  laanwj:
    ACK dc9305b616

Tree-SHA512: 18c2f336ea628f9cf7339b817381d230a18893fd9c0351bf99a39ca6f45c5b0a20af9d599d48d6c09515627d5edafa91337c17f9f790264251d2cdcb3763bbd5
2020-02-28 22:51:54 +01:00
MarcoFalke
faf6f156ff
test: Add missing syncwithvalidationinterfacequeue 2020-02-29 04:04:27 +07:00
MarcoFalke
7a266a679d
Merge #18173: refactor: test/bench: deduplicate SetupDummyInputs()
7bf4ce4f64 refactor: test/bench: dedup SetupDummyInputs() (Sebastian Falbesoner)

Pull request description:

  The only difference between `SetupDummyInputs()` in `test/transaction_tests.cpp` and the one in `bench/ccoins_caching.cpp` was the nValue amounts of the outputs, so we allow to pass those in an extra (fixed-size) array parameter.

ACKs for top commit:
  MarcoFalke:
    re-ACK 7bf4ce4f64, only change is schuffling includes 🚶
  Empact:
    ACK 7bf4ce4f64

Tree-SHA512: e13643b2470f6b6ab429da0c0a8eebd4cb41e2ff2e421ef36f85fa4847bf4ea8aab88d59a01e94cac4c4eb85edb561463f02215b174c50b573ac6bbcc2bf98a3
2020-02-29 03:23:04 +07:00
Sebastian Falbesoner
7bf4ce4f64 refactor: test/bench: dedup SetupDummyInputs()
The only difference between SetupDummyInputs() in test/transaction_tests.cpp
and the one in bench/ccoins_caching.cpp was the nValue amounts of the outputs,
so we allow to pass those in an extra (fixed-size) array parameter.
2020-02-28 21:09:03 +01:00
MarcoFalke
9aa8145bc0
Merge #17959: test: check specific reject reasons in feature_csv_activation.py
54be4e71d8 test: check specific reject reasons in feature_csv_activation.py (Sebastian Falbesoner)

Pull request description:

  This is kind of a prequel to #17921: increases the general quality of the functional test `feature_csv_activation.py` by checking for the specific reject reasons whenever the sending of a block fails. To get the reason, we have to limit the script threads to 1 via the parameter `-par=1`, like it is also done in `feature_cltv.py`:
  a654626f07/test/functional/feature_cltv.py (L57-L61)

  The commit also fixes a bug that was uncovered with this checks: for the BIP112 version 1 tx tests, txs from `bip112txs_vary_OP_CSV_v1` have been add twice to the list `failed_txs`:
  a654626f07/test/functional/feature_csv_activation.py (L396-L397)

  leading also to a block rejection as expected but for the wrong reason. It seems one of those two tx lists was meant to be `bip112txs_vary_OP_CSV_v1` (without the `_9`) and it was a typo.

ACKs for top commit:
  MarcoFalke:
    ACK 54be4e71d8 📶

Tree-SHA512: 9aac11aee3f53f1ae95ddb346a2f268872038f4d118c8dcf81b8201dee869774c9f3c3f1c326e370b8fd4eaf8e0673371689a96d9b1cb91be4286c88824725c3
2020-02-29 03:07:40 +07:00
Sebastian Falbesoner
54be4e71d8 test: check specific reject reasons in feature_csv_activation.py
this also fixes a bug that was uncovered with this checks:
for the BIP112 version 1 tx tests, certain txs (bip112txs_vary_OP_CSV_v1) have
been sent twice due to a typo, leading also to a failure as expected but for the
wrong reason
2020-02-28 20:42:23 +01:00
Wladimir J. van der Laan
5ad80bec3f
Merge #18135: build: add --enable-determinism configure flag
3d9b41ecc0 build: add --enable-determinism configure flag (fanquake)

Pull request description:

  This adds a `--enable-determinsm` configure flag, which if used, will enable additional compile / link time flags to make subsequent builds of bitcoind deterministic.

  The first flag enabled is `--no-insert-timestamp`. This prevents the linker from embedding timestamps, and makes consecutive builds of `bitcoind.exe` deterministic. This will likely also be used for [Guix Windows builds](https://github.com/bitcoin/bitcoin/pull/17595#issuecomment-582696467).

  [`--no-insert-timestamp`](https://manpages.debian.org/buster/binutils-mingw-w64-x86-64/x86_64-w64-mingw32-ld.bfd.1.en.html):
  > The option --no-insert-timestamp can be used to insert a zero value for the timestamp, this ensuring that binaries produced from identical sources will compare identically.

  Diff of consecutive builds of [master](2bdc476d4d):
  ```diff
  --- bitcoind.exe.1
  +++ bitcoind.exe.2
  @@ -2,20 +2,20 @@
   00000060: 7420 6265 2072 756e 2069 6e20 444f 5320  t be run in DOS
   00000070: 6d6f 6465 2e0d 0d0a 2400 0000 0000 0000  mode....$.......
  -00000080: 5045 0000 6486 1400 57e8 445e 00da 6900  PE..d...W.D^..i.
  +00000080: 5045 0000 6486 1400 e3e9 445e 00da 6900  PE..d.....D^..i.
   00000090: e015 0100 f000 2600 0b02 021f 00de 4900  ......&.......I.
   000000a0: 00b0 5b00 008a 0000 e014 0000 0010 0000  ..[.............
   000000b0: 0000 4000 0000 0000 0010 0000 0002 0000  ..@.............
   000000c0: 0400 0000 0000 0000 0500 0200 0000 0000  ................
  -000000d0: 00f0 6a00 0006 0000 bd31 af00 0300 6001  ..j......1....`.
  +000000d0: 00f0 6a00 0006 0000 d434 af00 0300 6001  ..j......4....`.
   000000e0: 0000 2000 0000 0000 0010 0000 0000 0000  .. .............
  @@ -373594,15 +373594,15 @@
   005b35f0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
  -005b3600: 0000 0000 57e8 445e 0000 0000 7ce1 5b00  ....W.D^....|.[.
  +005b3600: 0000 0000 e2e9 445e 0000 0000 7ce1 5b00  ......D^....|.[.
   005b3610: 0100 0000 2200 0000 2200 0000 28e0 5b00  ...."..."...(.[.
  ```

ACKs for top commit:
  practicalswift:
    ACK 3d9b41ecc0 -- patch looks correct
  laanwj:
    ACK 3d9b41ecc0

Tree-SHA512: 1ff9dab7fa818b1fc6b0eb3b7a1e0468aac9e2578f4451aa300a648f883fa83f83722067f1adf27ebad54157790857d1501d573adbd7ebdf6962858cc669960d
2020-02-28 19:08:38 +01:00
MarcoFalke
73cfa070e5
Merge #18195: test: Add cost_of_change parameter assertions to bnb_search_test
c72a11a1a0 test: Add cost_of_change parameter assertions to bnb_search_test (Yancy Ribbens)

Pull request description:

  If the `cost_of_change` variable is removed from the method body `SelectCoinsBnB`, there are currently no failing unit tests.  This PR adds assertions about the behavior of the `cost_of_change`:  If the cost of creating a change output is greater than what's leftover, then consume the output and create no change, otherwise, don't consume the output (no match found).

ACKs for top commit:
  achow101:
    ACK c72a11a1a0

Tree-SHA512: 613aa411df5e2911446e0e8bf3309336faaadf2d3c56e7d125b76454e7c6f9e4f5e8f0910dc6222282628e38cd8a4a7c56bb3d36b564a17f396b9b503ecc64c8
2020-02-29 00:39:52 +07:00
MarcoFalke
8888461f68
util: Fail to parse empty string in ParseMoney 2020-02-29 00:25:58 +07:00