Commit Graph

16803 Commits

Author SHA1 Message Date
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 d6af06d68aae985436cbc942f0d11078041d121b 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
Pasta
e4183b093d remove extra arg
Signed-off-by: Pasta <pasta@dashboost.org>
2019-09-07 12:33:13 -05:00
Wladimir J. van der Laan
40617436c6 Merge #10179: Give CValidationInterface Support for calling notifications on the CScheduler Thread
1f668b6 Expose if CScheduler is being serviced, assert its not in EmptyQueue (Matt Corallo)
3192975 Flush CValidationInterface callbacks prior to destruction (Matt Corallo)
08096bb Support more than one CScheduler thread for serial clients (Matt Corallo)
2fbf2db Add default arg to CScheduler to schedule() a callback now (Matt Corallo)
cda1429 Give CMainSignals a reference to the global scheduler (Matt Corallo)
3a19fed Make ValidationInterface signals-type-agnostic (Matt Corallo)
ff6a834 Use TestingSetup to DRY qt rpcnestedtests (Matt Corallo)

Tree-SHA512: fab91e34e30b080ed4d0a6d8c1214910e383c45440676e37be61d0bde6ae98d61e8903d22b846e95ba4e73a6ce788798350266feba246d8a2ab357e8523e4ac5
2019-09-07 12:33:13 -05:00
Wladimir J. van der Laan
9829a6dac1 Merge #10655: Properly document target_confirmations in listsinceblock
9f8a46f Properly document target_confirmations in listsinceblock (Ryan Havar)

Pull request description:

  There seems to be some misunderstandings about this, but it's a heavily used function so I'd like to make sure the docs are clear about how it works.

  For a later issue:
  * Change the default of target_confirmations to 6  (1 is a pretty silly default)
  * Change the name of target_confirmations (it's really a horrible name)

Tree-SHA512: a2fba2fab30019cea9db56cd7e31de95ba31090617ab336bdf130f9591bfcf3fc5fbd9e7e1e40b6c7bd2f74b9b4658afb1fdc7fc44e1f79520d1319758982a1c
2019-09-03 19:15:12 -05:00
Wladimir J. van der Laan
93754f8d85 Merge #10799: Prevent user from specifying conflicting parameters to fundrawtx
99c7fc3 Prevent user from specifying conflicting parameters to fundrawtx (Matt Corallo)

Pull request description:

  estimate_mode/conf_target both are overridden by feeRate, so should
  not be specified together with feeRate.

  Based on #10706

Tree-SHA512: 8ccd08575fd1f2a0d45112538ffbbc73983ee172963230b0cc7ac41d13c6f3c740917f82b212c41ded3a64d873452e7f2c7af49f3b47cab897f8e85117f21333
2019-09-03 19:14:02 -05:00
Pieter Wuille
05bed7009f Merge #10833: Fix typos
0189d8ed1 Fix typos (practicalswift)

Tree-SHA512: bac96ab13964e7579c93d63fc7550eb091c316767cc33f2a52c18cd786537650668799603414d418680a5e04516abf1e304b10d5f4ad48a5dcba24b3f09a0387
2019-09-03 19:11:04 -05:00
Pasta
0cccde9df7 fix all of the problems
Signed-off-by: Pasta <pasta@dashboost.org>
2019-09-03 18:55:21 -05:00
Pasta
791c07fb06 add gArgs
Signed-off-by: Pasta <pasta@dashboost.org>
2019-09-03 18:02:51 -05:00
Pasta
19b584c3ba remove some rbf
Signed-off-by: Pasta <pasta@dashboost.org>
2019-09-03 18:02:17 -05:00
Wladimir J. van der Laan
c849708996 Merge #10706: Improve wallet fee logic and fix GUI bugs
Contains RBF stuff to be removed in a later commit

11590d3 Properly bound check conf_target in wallet RPC calls (Alex Morcos)
fd29d3d Remove checking of mempool min fee from estimateSmartFee. (Alex Morcos)
2fffaa9 Make QT fee displays use GetMinimumFee instead of estimateSmartFee (Alex Morcos)
1983ca6 Use CoinControl to pass custom fee setting from QT. (Alex Morcos)
03ee701 Refactor to use CoinControl in GetMinimumFee and FeeBumper (Alex Morcos)
ecd81df Make CoinControl a required argument to CreateTransaction (Alex Morcos)

Pull request description:

  This builds on #10589  (first 5 commits from that PR, last 5 commits are new)

  The first couple commits refactor to use the CCoinControl class to pass fee calculation parameters around.

  This allows for fixing the buggy interaction in QT between the global payTxFee which can be modified by the RPC call settxfee or temporarily modified by the QT custom fee settings.  Before these changes the GUI could sometimes send a transaction with a recently set payTxFee and not respect the settings displayed in the GUI.   After these changes, using the GUI does not involve the global transaction confirm target or payTxFee.

  The prospective fee displays in the smart fee slider and the coin control dialog are changed to use the fee calculation from GetMinimumFee, this simplifies the code and makes them slightly more correct in edge cases.

  Maxing the fee calculation with the mempool min fee is move from estimateSmartFee to GetMinimumFee.

  This fixes a long standing bug, and should be tagged for 0.15 as it is holding up finalizing the estimatesmartfee RPC API before release.

Tree-SHA512: 4d36a1bd5934aa62f3806d380fcafbef73e9fe5bdf190fc5259a3e3a13349e5ce796e50e7068c46dc630ccf56d061bce5804f0bfe2e082bb01ca725b63efd4c1
2019-09-03 22:40:26 -05:00
MarcoFalke
c62c7ab6d6 Merge #10662: Initialize randomness in benchmarks
5155d11 Initialize randomness in benchmarks (Andrew Chow)

Tree-SHA512: 235006eb161893e1a84d5b2747cbaf7c82ced179ab2b9df30197b4cb2d3c4f31e47fa5b9cf62aced0fe244da47f3a38fbbe91fe86b0a90f1d86604da5d806fb1
2019-09-03 22:21:17 -05:00
Wladimir J. van der Laan
de1342791b Merge #10314: Remove unused forward declaration for non-existent ScriptPubKeyToJSON(...)
3fe8a83 Remove unused forward declaration for non-existent ScriptPubKeyToJSON(...) (practicalswift)

Tree-SHA512: 68d6a906fef86058ae7190228c7e65b5473b36f76b0cc53181b52c0de96f45d4a8dac0d1656f3793aaf4f79f4ca149ecb8293cc25b3f52fb09ceb114a343e933
2019-09-03 22:11:56 -05:00
UdjinM6
c22169d579
Reduce non-debug PS log output (#3076) 2019-09-03 22:48:35 +03:00
Alexander Block
41ae1c7e20 Add LDFLAGS_WRAP_EXCEPTIONS to dash_fuzzy linking (#3075) 2019-09-03 22:48:24 +03:00
UdjinM6
77b88558eb
Update/modernize macOS plist (#3074)
* Use 4-digit version numbers for macOS bundles

* Drop deprecated CFBundleGetInfoString and use NSHumanReadableCopyright instead
2019-09-03 22:48:14 +03:00
UdjinM6
f1ff148181
Fix bip69 vs change position issue (#3063)
* Fix bip69 vs change position issue

* Drop `setbip69enabled` rpc
2019-08-28 14:52:53 +03:00
UdjinM6
3a79b676a1
Merge pull request #3072 from PastaPastaPasta/backport-fuzzing
Backport fuzzing
2019-08-28 14:52:29 +03:00
UdjinM6
9abc393839
Refactor few things here and there (#3066)
* Refactor `HandleFullyConfirmedBlock()`

* Pass `pindexMined` into `AddNonLockedTx()`

* Unify time import in Dash specific tests

* Refactor UpdateSpork and SetPrivKey
2019-08-28 14:51:59 +03:00
UdjinM6
f2dcac3a4f
Merge #10757: RPC: Introduce getblockstats to plot things (#3058)
* Merge #10757: RPC: Introduce getblockstats to plot things

41d0476f62269027ec2193a5f80d508d789de8aa Tests: Add data file (Anthony Towns)
4cbfb6aad9ba8fa17b5e7ed3e9a36dc8a24f1fcf Tests: Test new getblockstats RPC (Jorge Timón)
35e77a0288bcac5594ff25c10c9679a161cb730b RPC: Introduce getblockstats (Jorge Timón)
cda8e36f019dd181e5c3774961b4f1335e5602cb Refactor: RPC: Separate GetBlockChecked() from getblock() (Jorge Timón)

Pull request description:

  It returns per block statistics about several things. It should be easy to add more if people think of other things to add or remove some if I went too far (but once written, why not keep it? EDIT: answer: not to test or maintain them).

  The currently available options are: minfee,maxfee,totalfee,minfeerate,maxfeerate,avgfee,avgfeerate,txs,ins,outs (EDIT: see updated list in the rpc call documentation)

  For the x axis, one can use height or block.nTime (I guess I could add mediantime if there's interest [EDIT: nobody showed interest but I implemented mediantime nonetheless, in fact there's no distinction between x or y axis anymore, that's for the caller to judge]).

  To calculate fees, -txindex is required.

Tree-SHA512: 2b2787a3c7dc4a11df1fce62c8a4c748f5347d7f7104205d5f0962ffec1e0370c825b49fd4d58ce8ce86bf39d8453f698bcd46206eea505f077541ca7d59b18c

* Replace get_mocktime() usage with self.mocktime
2019-08-28 14:50:29 +03:00