Commit Graph

16721 Commits

Author SHA1 Message Date
UdjinM6
4b579c77aa
Fix remaining issues 2019-09-20 10:30:04 -05:00
Wladimir J. van der Laan
02328ae966
Merge #11044: [wallet] Keypool topup cleanups
67ceff4 [wallet] Add logging to MarkReserveKeysAsUsed (John Newbery)
1221f60 [wallet] Remove keypool_topup_cleanups (John Newbery)

Pull request description:

  A couple of minor cleanups suggested by @ryanofsky here: https://github.com/bitcoin/bitcoin/pull/11022#pullrequestreview-55598940

  Does not affect functionality. Not required for v0.15.

Tree-SHA512: d8d0698fd26ea49a4157e68669d5511095760c3a1ecfa3f917e3f273efbafb55c51a202d677614216eae3f796b6e8d17506b2ec2d4799a94f18981b396e65eec
2019-09-20 10:30:04 -05:00
Pasta
ac07bf609e
revert unintentional change, 10758
Signed-off-by: Pasta <pasta@dashboost.org>
2019-09-20 10:30:04 -05:00
Pasta
3d445628a4
remove LogPrintf("Initializing databases...\n");
Signed-off-by: Pasta <pasta@dashboost.org>
2019-09-20 10:30:04 -05:00
Wladimir J. van der Laan
e941c9ba5a
Merge #11028: Avoid masking of difficulty adjustment errors by checkpoints
85c82b5 Avoid masking of difficulty adjustment errors by checkpoints (Pieter Wuille)

Pull request description:

  Currently difficulty adjustment violations are not reported for chains that branch off before the last checkpoint. Change this by moving the checkpoint check after the difficulty check.

Tree-SHA512: 33666f2c3459151b28c42041a463779e6df18f61d3dd5b1879a0af4e5b199ef74d1e33e06af68bebfdfb211569ad5fb56556bfebe9d63b5688d910ea211b839a
2019-09-20 10:30:04 -05:00
Pasta
2d922f5d31
fix
Signed-off-by: Pasta <pasta@dashboost.org>
2019-09-20 10:30:04 -05:00
Wladimir J. van der Laan
c438c9322f
Merge #11022: Basic keypool topup
d34957e [wallet] [tests] Add keypool topup functional test (Jonas Schnelli)
095142d [wallet] keypool mark-used and topup (John Newbery)
c25d90f [wallet] Add HasUnusedKeys() helper (John Newbery)
f2123e3 [wallet] Cache keyid -> keypool id mappings (John Newbery)
83f1ec3 [wallet] Don't hold cs_LastBlockFile while calling setBestChain (John Newbery)
2376bfc [wallet] [moveonly] Move LoadKeyPool to cpp (Matt Corallo)
cab8557 [wallet] [moveonly] Move CAffectedKeysVisitor (Jonas Schnelli)

Pull request description:

  This PR contains the first part of #10882 :

  - if a key from the keypool is used, mark all keys up to that key as used, and then try to top up the keypool
  - top up the keypool on startup

  Notably, it does not stop the node or prevent the best block from advancing if the keypool drops below a threshold (which means that transactions may be missed and funds lost if restoring from an old HD wallet backup).

Tree-SHA512: ac681fefeaf7ec2aab2fa1da93d12273ea80bd05eb48d7b3b551ea6e5d975dd97ba7de52b7fba52993823280ac4079cc36cf78a27dac708107ebf8fb6326142b
2019-09-20 10:30:04 -05:00
Wladimir J. van der Laan
d5fdf62faa
Merge #10919: Fix more init bugs.
e7539f8 Fix some broken init-time prints/constants (Matt Corallo)
13ab353 Check for empty coinsview instead of just-reset coinsview in init (Matt Corallo)
fce3f4f Fix resume-of-reindex-after-restart (Matt Corallo)
efac91e Always wait for threadGroup to exit in bitcoind shutdown (Matt Corallo)

Pull request description:

  This is a follow-on to #10758 to help move 10758 along. The first fixes a regression in master that was partially fixed in 10758, the second I'm not sure if its a regression or not, but its clearly a bug that should be fixed.

Tree-SHA512: aca7b97a97dca66e1a218a33cc6f4aa002292ff1bb0af64e35b81fbaa91b9504f2605375808b43e93a63fc73634ad079b30ef6c9f4ba338d3b5f72d816dfeaff
2019-09-20 10:30:04 -05:00
Alexander Block
7662c0b79a A couple of fixes 2019-09-20 11:10:07 +02:00
Alexander Block
16bd20e57c Remove segwit related code 2019-09-20 11:10:06 +02:00
Pieter Wuille
21eca6481f BIP143: Signing logic 2019-09-20 11:09:59 +02:00
Pieter Wuille
fff708d3a3 BIP143: Verification logic
Includes simplifications by Eric Lombrozo.
2019-09-19 21:04:36 +02:00
Pieter Wuille
8da543f279 Refactor script validation to observe amounts
This is a preparation for BIP143 support.
2019-09-19 21:04:36 +02:00
Pasta
1f06ecdd5a add gargs
Signed-off-by: Pasta <pasta@dashboost.org>
2019-09-18 17:44:58 -05:00
Pasta
9f71ab04bd remove chainparams from method call (10758)
Signed-off-by: Pasta <pasta@dashboost.org>
2019-09-18 17:41:16 -05:00
Pasta
05ad6d2ecb change nEnd to index (might break the progress bar on wallet creation, should test)
Signed-off-by: Pasta <pasta@dashboost.org>
2019-09-18 17:35:44 -05:00
Wladimir J. van der Laan
cd5a12f9fb Merge #10862: Remove unused variable int64_t nEnd. Fix typo: "conditon" → "condition".
5a6671c Fix typo: "conditon" → "condition" (practicalswift)
35aff43 Remove unused variable int64_t nEnd (practicalswift)

Pull request description:

  * Remove unused variable `int64_t nEnd`. Last use of `nEnd` removed in commit 1fc8c3d.
  * Fix typo: "conditon" → "condition". Typo introduced in commit 439c4e8.

Tree-SHA512: 61624e6f70828c485fe46dbe00df76f1a07b7a5849d41bf7d279323b687420e60e9b85192f611a37211f17f3dea8eb3f6f6dc65d90c92e5516404fd81d37785a
2019-09-18 17:31:02 -05:00
Pasta
714438af44 remove rewinding blocks
Signed-off-by: Pasta <pasta@dashboost.org>
2019-09-18 17:31:02 -05:00
Wladimir J. van der Laan
dbd4993084 Merge #10758: Fix some chainstate-init-order bugs.
c0025d0 Fix segfault when shutting down before fully loading (Matt Corallo)
1385697 Order chainstate init more logically. (Matt Corallo)
ff3a219 Call RewindBlockIndex even if we're about to run -reindex-chainstate (Matt Corallo)
b0f3249 More user-friendly error message if UTXO DB runs ahead of block DB (Matt Corallo)
eda888e Fix some LoadChainTip-related init-order bugs. (Matt Corallo)

Pull request description:

  This does a number of things to clean up chainstate init order,
  fixing some issues as it goes:

  * Order chainstate init more logically - first all of the
    blocktree-related loading, then coinsdb, then
    pcoinsTip/chainActive. Only create objects as needed.

  * More clearly document exactly what is and isn't called in
    -reindex and -reindex-chainstate both with comments noting
    calls as no-ops and by adding if guards.

  * Move the writing of fTxIndex to LoadBlockIndex - this fixes a
    bug introduced in d6af06d68a where
    InitBlockIndex was writing to fTxIndex which had not yet been
    checked (because LoadChainTip hadn't yet initialized the
    chainActive, which would otherwise have resulted in
    InitBlockIndex being a NOP), allowing you to modify -txindex
    without reindex, potentially corrupting your chainstate!

  * Rename InitBlockIndex to LoadGenesisBlock, which is now a more
    natural name for it. Also check mapBlockIndex instead of
    chainActive, fixing a bug where we'd write the genesis block out
    on every start.

  * Move LoadGenesisBlock further down in init. This is a more logical
    location for it, as it is after all of the blockindex-related
    loading and checking, but before any of the UTXO-related loading
    and checking.

  * Give LoadChainTip a return value - allowing it to indicate that
    the UTXO DB ran ahead of the block DB. This just provides a nicer
    error message instead of the previous mysterious
    assert(!setBlockIndexCandidates.empty()) error.

  * Calls ActivateBestChain in case we just loaded the genesis
    block in LoadChainTip, avoiding relying on the ActivateBestChain
    in ThreadImport before continuing init process.

  * Move all of the VerifyDB()-related stuff into a -reindex +
    -reindex-chainstate if guard. It couldn't do anything useful
    as chainActive.Tip() would be null at this point anyway.

Tree-SHA512: 3c96ee7ed44f4130bee3479a40c5cd99a619fda5e309c26d60b54feab9f6ec60fabab8cf47a049c9cf15e88999b2edb7f16cbe6819e97273560b201a89d90762
2019-09-18 17:31:02 -05:00
Wladimir J. van der Laan
0631cd95da Merge #10789: Punctuation/grammer fixes in rpcwallet.cpp
a5ecaf1 Fix misspellings and remove safety verbiage (Steven D. Lander)

Pull request description:

  Standardizing punctuation on CLI output and also including a few fixes for grammer.  This PR is for text only changes and includes no code edits.

Tree-SHA512: afde551bf1212838822188b6723f2bf1b7222decfa1cd7aa6b04967489108a29f80833af6059252af028c53437755f258275af0614e0d4d0311e09421cd8e131
2019-09-18 17:31:02 -05:00
Pasta
75e8e0a45a add a zero to the GenerateNewKey call
Signed-off-by: Pasta <pasta@dashboost.org>
2019-09-18 17:30:20 -05:00
Pasta
11e41b90c9 internal -> fInternal
Signed-off-by: Pasta <pasta@dashboost.org>
2019-09-18 17:30:20 -05:00
Wladimir J. van der Laan
b8c1d66fb9 Merge #10795: No longer ever reuse keypool indexes
1fc8c3d No longer ever reuse keypool indexes (Matt Corallo)

Pull request description:

  This fixes an issue where you could reserve a keypool entry, then
  top up the keypool, writing out a new key at the given index, then
  return they key from the pool. This isnt likely to cause issues,
  but given there is no reason to ever re-use keypool indexes
  (they're 64 bits...), best to avoid it alltogether.

  Builds on #10235, should probably get a 15 tag.

Tree-SHA512: c13a18a90f1076fb74307f2d64e9d80149811524c6bda259698ff2c65adaf8c6c3f2a3a07a5f4bf03251bc942ba8f5fd33a4427aa4256748c40b062991682caf
2019-09-18 17:30:20 -05:00
Pieter Wuille
d04633d28c Merge #10707: Better API for estimatesmartfee RPC
06bcdb8da Convert named argument from nblocks to conf_target (Alex Morcos)
439c4e8ad Improve api to estimatesmartfee (Alex Morcos)

Pull request description:

  Through 0.14 branch, the estimatesmartfee API was tagged "WARNING: This interface is unstable and may disappear or change!" and this warning is removed for 0.15, so any wanted API updates should happen now.

  The changes here are to make the additional parameter for conservative estimates a more general estimate_mode string , to omit the feerate and include an error string instead of returning -1 on error, and to do better parameter checking initially.

  ~It is only the last 2 commits, but it's built on #10706 and #10543~.

  See https://github.com/bitcoin/bitcoin/pull/10707#issuecomment-314869251 for renaming of nblocks argument to conf_target.  Will need to be included before string freeze.

  PR description edited for clarity

Tree-SHA512: 6d8ebee8bb410e2950ffd59663eebfed8d1611d995dc935bb91e430d9da7e2f306796f45631458376027d26341c660f09e825e61748103d2f2736ec6dc3df3ae
2019-09-18 17:30:20 -05:00
PastaPastaPasta
1acde17e8a Don't care about governance cache while the blockchain isn't synced yet (#3089)
`2019-09-14 05:31:13 CGovernanceManager::UpdateCachesAndClean -- Governance Objects: 0 (Proposals: 0, Triggers: 0, Other: 0; Erased: 0), Votes: 0
 59m
 60m
`

Signed-off-by: Pasta <pasta@dashboost.org>
2019-09-17 15:09:04 +03:00
UdjinM6
0d126c2ae4
Use chainparams factory for devnet (#3087) 2019-09-17 15:08:37 +03:00
PastaPastaPasta
ac90abe892 When mixing, always try to join an exsisting queue, only fall back to starting a new queue (#3085)
Signed-off-by: Pasta <pasta@dashboost.org>
2019-09-17 15:07:56 +03:00
PastaPastaPasta
65cd334794 Tools window: Information - make "InstantSend locks" and "Number of Masternodes" fields copyable
Signed-off-by: Pasta <pasta@dashboost.org>
2019-09-15 23:09:01 +03:00
PastaPastaPasta
68d575dc0d Masternodes should have no wallet enabled (#3084) 2019-09-15 23:08:21 +03:00
PastaPastaPasta
6b5b70fab8 Remove liquidity provider privatesend (#3082)
* remove liquidity provider. The reason behind this is two fold:
1. it is very likely nobody is currently running this on the mainnet (due to already strong liquidity), it provides no use for testnet as there you can just enable mixing and get the same affect. Because of this reason I don't find it okay to just remove it outright.
2. even if people did use it (or if some do as a novelty) it likely hurts the privacy of the system. This is because as a liquidity provider your outputs will always take many (sometimes hundreds) blocks before being used in a new mixing round, whereas real user's funds will normally be mixed again very rapidly.

Signed-off-by: Pasta <pasta@dashboost.org>

* remove unused function

Signed-off-by: Pasta <pasta@dashboost.org>
2019-09-15 23:08:05 +03:00
PastaPastaPasta
0b2221ed6b Clarify default max peer connections (#3081)
* clarify comment regarding default peer connections and how that applies to MNs

Signed-off-by: Pasta <pasta@dashboost.org>

* clarify debug log when maxconnections is force set

Signed-off-by: Pasta <pasta@dashboost.org>
2019-09-15 23:07:11 +03:00
UdjinM6
b874fcc8c5
Merge pull request #3080 from PastaPastaPasta/backport-0.15-pr25
Backport 0.15 pr25
2019-09-15 23:06:37 +03:00
PastaPastaPasta
ddef2025bb
sat -> duff
thanks @thephez
2019-09-11 15:42:05 -05:00
UdjinM6
a7e20cd4c2
Use chainparams passed into ATMPW 2019-09-08 21:01:02 -05:00
UdjinM6
e6df5690a2
Drop segwit related parts and fix cs_main issues 2019-09-08 21:00:54 -05:00
UdjinM6
70e386580d
Backport meaningful parts of 8149/2b1f6f9ccf36f1e0a2c9d99154e1642f796d7c2b 2019-09-08 21:00:44 -05:00
Wladimir J. van der Laan
6fd35565a3
Merge #13527: policy: Remove promiscuousmempoolflags
faa24441ec047ec336b86f586016b9d318c1c0ad policy: Remove promiscuousmempoolflags (MarcoFalke)

Pull request description:

  It seems odd to clutter validation code with features that can only ever be used for testing (testnet or regtest). Removing that test-only code makes the mempool logic less painful to understand and easier to reason about when changed or refactored in the future.

Tree-SHA512: 3b897aa9604ac8d82ebe9573c6efd468c93ddaa08d378ebc902e247b7aa6c68fcde71e5b449c08f17a067146cdc66dc50a67ce06d07607c27e5189a49c3fba3f
2019-09-08 21:00:33 -05:00
PastaPastaPasta
9b8df2f52a
add dip3params
Co-Authored-By: UdjinM6 <UdjinM6@users.noreply.github.com>
2019-09-08 11:10:36 -05:00
Pasta
6fc9285412
Merge bitcoin#10695: [qa] Rewrite BIP65/BIP66 functional tests
4ccc12a [qa] Rewrite BIP66 functional tests (Suhas Daftuar)
d4f0d87 [qa] Rewrite BIP65 functional tests (Suhas Daftuar)

Pull request description:

  After 122786d, BIP65 and BIP66 activate at
  particular fixed heights (without regard to version numbers of blocks
  below those heights).  Rewrite the functional tests to take
  this into account, and remove two tests that weren't really testing anything.

  Moves the rewritten functional tests out of the extended test suite, so that they run in travis regularly.

  Note: I discovered that the ComparisonTestFramework (which the original versions of these p2p tests were written is, has a bug that caused them to not catch obvious errors, eg if you just comment out setting the script flags for these softforks in ConnectBlock, the versions of these tests in master do not fail(!) -- will separately PR a fix for the comparison test framework).
2019-09-08 11:07:07 -05:00
Wladimir J. van der Laan
eda5dac9f4
Merge #10192: Cache full script execution results in addition to signatures
e3f9c05 Add CheckInputs() unit tests (Suhas Daftuar)
a3543af Better document CheckInputs parameter meanings (Matt Corallo)
309ee1a Update -maxsigcachesize doc clarify init logprints for it (Matt Corallo)
b014668 Add CheckInputs wrapper CCoinsViewMemPool -> non-consensus-critical (Matt Corallo)
eada04e Do not print soft-fork-script warning with -promiscuousmempool (Matt Corallo)
b5fea8d Cache full script execution results in addition to signatures (Matt Corallo)
6d22b2b Pull script verify flags calculation out of ConnectBlock (Matt Corallo)

Tree-SHA512: 0c6c3c79c64fcb21e17ab60290c5c96d4fac11624c49f841a4201eec21cb480314c52a07d1e3abd4f9c764785cc57bfd178511f495aa0469addb204e96214fe4
2019-09-08 11:04:44 -05:00
MarcoFalke
3e7ff33068
Merge #10835: Rename member field according to the style guide
4d4fb33fc Rename member field according to the style guide. (Pavel Janík)

Pull request description:

  After #10193, approx. five instances of this warning are printed when compiling with `-Wshadow`:

  ```
  In file included from txmempool.cpp:14:
  ./reverse_iterator.h:20:22: warning: declaration shadows a field of 'reverse_range<T>' [-Wshadow]
      reverse_range(T &x) : x(x) {}
                       ^
  ./reverse_iterator.h:17:8: note: previous declaration is here
      T &x;
         ^
  1 warning generated.
  ```

Tree-SHA512: 6c07c2ed6f4f232a3a8bdcdd6057040967c74552fd29d80f42e8a453b95baf203c410aa31dccc08ff2e765cbba02b1a282f6ea7804955f09b31ab20ef383792e
2019-09-08 10:52:42 -05:00
MarcoFalke
d2f1259c8a
Merge #11029: [RPC] trivial: gettxout no longer shows version of tx
86279464b [RPC] trivial: gettxout no longer shows version of tx (Felix Weis)

Pull request description:

  Since the switch to a per-txout chainstate db in #10195, the tx version information is no longer stored. Updated `gettxout` rpc help text accordingly.

Tree-SHA512: 3d7f42ef0f649056ece98bf22a1e972d1876324733adc81fa31bc2cd160550c5b6cb8682209fb8e8dbc56a8139ed5f5f0e740945f709039e69d52997ddbca7b8
2019-09-08 10:52:42 -05:00
Wladimir J. van der Laan
c2e6a2f9cf Merge #10949: Clarify help message for -discardfee
bdd5543 Clarify help message for -discardfee (Alex Morcos)

Pull request description:

Tree-SHA512: 7c2f644d1c18e18f11fd85a7b6ca38c480e1ee3932daa4bb19a3965b88146dda899ead0f34d8da02db640598197167bcf69d511501b729e3a8b5b7b6adf08d4e
2019-09-08 00:11:15 -05:00
Wladimir J. van der Laan
ec366d2595 Merge #10817: Redefine Dust and add a discard_rate
f4d00e6 Add a discard_rate (Alex Morcos)
b138585 Remove factor of 3 from definition of dust. (Alex Morcos)

Pull request description:

  The definition of dust is redefined to remove the factor of 3.

  Dust is redefined to be the value of an output such that it would
  cost that value in fees to (create and) spend the output at the dust
  relay rate.  The previous definition was that it would cost 1/3 of the
  value.  The default dust relay rate is correspondingly increased to
  3000 sat/kB so the actual default dust output value of 546 satoshis
  for a non-segwit output remains unchanged.  This commit is a refactor
  only unless a dustrelayfee is passed on the commandline in which case
  that number now needs to be increased by a factor of 3 to get the same
  behavior.  -dustrelayfee is a hidden command line option.

  Note: It's not exactly a refactor due to edge case changes in rounding
  as evidenced by the required change to the unit test.

  A discard_rate is added which defaults to 10,000 sat/kB

  Any change output which would be dust at the discard_rate you are
  willing to discard completely and add to fee (as well as continuing to
  pay the fee that would have been needed for creating the change)

  This would be a nice addition for 0.15 and I think will remain useful for 0.16 with the new coin selection algorithms in discussion, but its not crucial.

  It does add translation strings, but we could (should?) avoid that by hiding the option

Tree-SHA512: 5b6f655354d0ab6b8b6cac1e8d1fe3136d10beb15c6d948fb15bfb105155a9d03684c6240624039b3eed6428b7e60e54216cc8b2f90c4600701e39f646284a9b
Signed-off-by: Pasta <pasta@dashboost.org>
2019-09-08 00:11:05 -05:00
Wladimir J. van der Laan
443b577931 Merge #10784: Do not allow users to get keys from keypool without reserving them
cf82a9e Do not allow users to get keys from keypool without reserving them (Matt Corallo)

Pull request description:

  fundrawtransaction allows users to add a change output and then
  not have it removed from keypool. While it would be nice to have
  users follow the normal CreateTransaction/CommitTransaction process
  we use internally, there isnt much benefit in exposing this option,
  especially with HD wallets, while there is ample room for users to
  misunderstand or misuse this option.

  This partially reverts #9377. Would be nice to get this for 15 since its kinda crazy we have this option to begin with IMO, will need release notes as an RPC option is now ignored.

Tree-SHA512: 72b5ee9c4a229b84d799dfb00c56fe80d8bba914ce81a433c3f5ab325bf9bf2b839ee658c261734f0ee183ab19435039481014d09c41dbe155e6323e63beb01d
2019-09-08 00:10:56 -05:00
Pasta
3b7d3c90d9 Merge #10501: remove some unused functions -- ignoring removal of SetPort due to dash#2168
f228b8e remove some unused functions (Marko Bencun)

Pull request description:

  Identified with `cppcheck --enable=unusedFunction .`.

   - GetSendBufferSize()'s last use removed in
     991955e
   - SetPort()'s last use removed in
     7e195e8
   - GetfLargeWorkInvalidChainFound() was introduced in
     e3ba0ef and never used

Tree-SHA512: ea8e5498bec981e42e1342c171c37723c2f5e575c7d6c1a524d9c6cd9b332bdd0d84fddf9e14ca011bb49fb82bd037386382c9afc546b3c2231ae548358bd4f4
Signed-off-by: Pasta <pasta@dashboost.org>
2019-09-08 00:10:48 -05:00
Wladimir J. van der Laan
3e483659a8 Merge #10914: Add missing lock in CScheduler::AreThreadsServicingQueue()
a56f8b0 Add missing lock in CScheduler::AreThreadsServicingQueue() (Matt Corallo)

Pull request description:

  Not an actual bug as this is only used in asserts right now, but
  nice to not have a missing lock.

Tree-SHA512: 7e542b150a0be716783e196493d239f2ad15e5376abf54b67d735dc3ef1b10849c090337b849f530c9f7497ddcfb8389b47d64a5dcf6382b7d38838f88cc1100
2019-09-08 00:10:37 -05:00
UdjinM6
a80f42eabd Still pass the disconect block index 2019-09-07 22:37:16 -05:00
UdjinM6
6dce8d2736 Fix includes 2019-09-07 22:36:46 -05:00
Pasta
91a4b775a7 fix some things
Signed-off-by: Pasta <pasta@dashboost.org>
2019-09-07 12:33:13 -05:00