Commit graph

88 commits

Author SHA1 Message Date
Wladimir J. van der Laan 26f5b34e88
Merge pull request #6877
10e2eae rpc: Add maxmempool and effective min fee to getmempoolinfo (Wladimir J. van der Laan)
2015-10-26 10:07:04 +01:00
Wladimir J. van der Laan 10e2eae35c rpc: Add maxmempool and effective min fee to getmempoolinfo 2015-10-26 09:59:07 +01:00
Peter Todd 65ef372302
Add BIP65 to getblockchaininfo softforks list 2015-10-08 17:37:10 +02:00
Jonas Schnelli 9623e93473 [Univalue] add univalue over subtree
similar to secp256k1 include and compile univalue over a subtree
2015-10-01 10:49:57 +02:00
Suhas Daftuar 5add7a74a6 Track transaction packages in CTxMemPoolEntry
Associate with each CTxMemPoolEntry all the size/fees of descendant
mempool transactions.  Sort mempool by max(feerate of entry, feerate
of descendants).  Update statistics on-the-fly as transactions enter
or leave the mempool.

Also add ancestor and descendant limiting, so that transactions can
be rejected if the number or size of unconfirmed ancestors exceeds
a target, or if adding a transaction would cause some other mempool
entry to have too many (or too large) a set of unconfirmed in-
mempool descendants.
2015-09-19 13:25:48 -04:00
Ashley Holman 34628a1807 TxMemPool: Change mapTx to a boost::multi_index_container
Indexes on:
- Tx Hash
- Fee Rate (fee-per-kb)
2015-09-19 13:22:40 -04:00
Pavel Janík 70180b2e57 Implement REST mempool API, add test and documentation. 2015-08-14 07:01:03 +02:00
Ross Nicoll 9ca7857df7 Rationalize currency unit to "BTC"
Previously various user-facing strings have used inconsistent currency units "BTC",
"btc" and "bitcoins". This adds a single constant and uses it for each reference to
the currency unit.

Also adds a description of the unit for --maxtxfee, and adds the missing "amount"
field description to the (deprecated) move RPC command.
2015-08-03 22:58:30 +01:00
Jorge Timón 9dd793f499 TRIVIAL: Missing includes 2015-07-23 21:10:22 +02:00
Simon Males 0ef9858707 Documenting pruned, pruneheight and softforks in getblockchaininfo 2015-07-19 14:07:35 +02:00
Pieter Wuille 5098c47b24 Implement accurate memory accounting for mempool 2015-07-10 10:49:31 -04:00
Jonas Schnelli c45c7ea0fa [REST] add JSON support for /rest/headers/ 2015-07-05 15:48:33 +02:00
Wladimir J. van der Laan 726e28643c
Merge pull request #6247
076badb Add getblockheader RPC call (Peter Todd)
2015-07-02 18:53:18 +02:00
Wladimir J. van der Laan 5ed10793c2 Show softfork status in getblockchaininfo 2015-07-01 19:36:17 +02:00
Wladimir J. van der Laan 57092ed9e7 rpc: make gettxoutsettinfo run lock-free
For leveldb "An iterator operates on a snapshot of the database taken
when the iterator is created". This means that it is unnecessary to
lock out other threads while computing statistics, and neither to hold
cs_main for the whole time. Let the thread run free.
2015-06-16 13:50:38 +02:00
Peter Todd 076badb60f
Add getblockheader RPC call
Alternative to getblock that works even when the block itself has been
pruned, returning all available information.
2015-06-05 17:07:58 -02:30
Jonas Schnelli c7fbbc7e1d fix missing univalue types during constructing 2015-06-04 09:16:21 +02:00
Jonas Schnelli 9a8897f4ac Remove JSON Spirit wrapper, remove JSON Spirit leftovers
- implement find_value() function for UniValue
- replace all Array/Value/Object types with UniValues, remove JSON Spirit to UniValue wrapper
- remove JSON Spirit sources
2015-06-04 09:16:21 +02:00
Jonas Schnelli 3df0411ad9 remove JSON Spirit UniValue wrapper 2015-06-04 09:16:06 +02:00
Jonas Schnelli 6c7bee0624 expicit set UniValue type to avoid empty values 2015-06-04 09:16:05 +02:00
Jonas Schnelli 53b4671a9d extend conversion to UniValue 2015-06-04 09:16:05 +02:00
Jeff Garzik 15982a8b69 Convert tree to using univalue. Eliminate all json_spirit uses. 2015-06-04 09:16:05 +02:00
jtimon da29ecbcc6 Consensus: MOVEONLY: Move CValidationState from main consensus/validation 2015-05-15 16:05:28 +02:00
Chris Arnesen 803f51efe4 Typo in GetRawMemPool RPC method help: "]" --> "}" 2015-05-14 01:02:00 -04:00
Wladimir J. van der Laan 7e0e7f823f
Merge pull request #6058
03c5687 appropriate response when trying to get a block in pruned mode (Jonas Schnelli)
1b2e555 add autoprune information to RPC "getblockchaininfo" (Jonas Schnelli)
2015-05-11 16:40:58 +02:00
Jonas Schnelli 03c56872b5 appropriate response when trying to get a block in pruned mode 2015-05-11 16:10:08 +02:00
Cory Fields 11982d366d checkpoints: Decouple checkpoints from Params
Pass checkpoint data in as necessary
2015-04-30 23:14:48 -04:00
Jonas Schnelli 1b2e555593 add autoprune information to RPC "getblockchaininfo" 2015-04-26 23:23:09 +02:00
Eric Lombrozo 4401b2d7c5 Removed main.h dependency from rpcserver.cpp
Rebased by @laanwj:

- update for RPC methods added since 84d13ee: setmocktime,
  invalidateblock, reconsiderblock. Only the first, setmocktime, required a change,
  the other two are thread safe.
2015-01-28 07:41:54 +01:00
Wladimir J. van der Laan 34cdc41128 String conversions uint256 -> uint256S
If uint256() constructor takes a string, uint256(0) will become
dangerous when uint256 does not take integers anymore (it will go
through std::string(const char*) making a NULL string, and the explicit
keyword is no help).
2015-01-05 15:45:35 +01:00
Wladimir J. van der Laan 4f1524966a Replace direct use of 0 with SetNull and IsNull
Replace x=0 with .SetNull(),
x==0 with IsNull(), x!=0 with !IsNull().
Replace uses of uint256(0) with uint256().
2015-01-05 15:45:34 +01:00
sandakersmann f914f1a746
Added "Core" to copyright headers
Github-Pull: #5494
Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-19 19:55:32 +01:00
Jonas Schnelli 932ef50f77 [REST] JSON output: remove block infos from tx details if it is nested in block 2014-12-09 16:05:51 +01:00
Jonas Schnelli 73351c3686 [REST] /rest/block response with full tx details
- rest block request returns full unfolded tx details
- /rest/block/notxdetails/<HASH> returns block where transactions are only represented by its hash
2014-12-09 16:05:50 +01:00
Pieter Wuille 32b93a1bc2 Extra explanation for getchaintips 2014-12-01 20:48:50 +01:00
Wladimir J. van der Laan 0ddf4416cc
Merge pull request #5386
1b91be4 Report status of chain tips (Pieter Wuille)
2014-12-01 11:49:35 +01:00
Pieter Wuille 1b91be49f5 Report status of chain tips 2014-11-27 11:50:14 +01:00
Pieter Wuille 9b0a8d3152 Add 'invalidateblock' and 'reconsiderblock' RPC commands.
These can be used for testing reorganizations or for manual intervention in case of
chain forks.
2014-11-26 16:36:25 +01:00
Pieter Wuille 51ce901aa3 Improve chainstate/blockindex disk writing policy
There are 3 pieces of data that are maintained on disk. The actual block
and undo data, the block index (which can refer to positions on disk),
and the chainstate (which refers to the best block hash).

Earlier, there was no guarantee that blocks were written to disk before
block index entries referring to them were written. This commit introduces
dirty flags for block index data, and delays writing entries until the actual
block data is flushed.

With this stricter ordering in writes, it is now safe to not always flush
after every block, so there is no need for the IsInitialBlockDownload()
check there - instead we just write whenever enough time has passed or
the cache size grows too large. Also updating the wallet's best known block
is delayed until this is done, otherwise the wallet may end up referring to an
unknown block.

In addition, only do a write inside the block processing loop if necessary
(because of cache size exceeded). Otherwise, move the writing to a point
after processing is done, after relaying.
2014-11-24 15:15:40 +01:00
Michael Ford 72fb3d295a Update comments in src/rpc* to be doxygen compatible 2014-11-20 10:19:39 +08:00
Philip Kaufmann 771d500283 minor cleanup: include orders, end comments etc.
- no code changes
2014-10-31 09:41:15 +01:00
Wladimir J. van der Laan d9702bcf7c
Merge pull request #5115
33dfbf5 rpc: Fix leveldb iterator leak, and flush before `gettxoutsetinfo` (Wladimir J. van der Laan)
2014-10-27 11:05:20 +01:00
dexX7 6261e6e6e0
getblockhash: throw JSONRPCError (not runtime_error) 2014-10-24 19:18:03 +02:00
Wladimir J. van der Laan 33dfbf57d3
rpc: Fix leveldb iterator leak, and flush before gettxoutsetinfo
This fixes an iterator leak resulting in

    bitcoind: db/version_set.cc:789: leveldb::VersionSet::~VersionSet(): Assertion `dummy_versions_.next_ == &dummy_versions_' failed."

exception on shutdown.

Also make sure to flush pcoinsTip before calling GetStats() to make
sure we apply them to the current height.
2014-10-21 16:16:55 +02:00
Pieter Wuille ad6e601712 RPC additions after headers-first 2014-10-14 15:42:01 -07:00
Pieter Wuille 7c70438dc6 Get rid of the dummy CCoinsViewCache constructor arg 2014-09-24 03:19:04 +02:00
Pieter Wuille 145d5be896 Introduce BlockMap type for mapBlockIndex 2014-09-04 02:04:51 +02:00
Wladimir J. van der Laan 93f97aab62
Merge pull request #4768
2e28031 Perform CVerifyDB on pcoinsdbview instead of pcoinsTip (Wladimir J. van der Laan)
2014-09-01 09:42:10 +02:00
Wladimir J. van der Laan 57153d4e1a rpc: Compute number of confirmations of a block from block height
Currently this uses a CMerkleTx, but that makes no sense as we
have the CBlockIndex available. As noted by @jgarzik.
2014-08-29 17:25:23 +02:00
Wladimir J. van der Laan 2e280311b8
Perform CVerifyDB on pcoinsdbview instead of pcoinsTip
Bypassing the main coins cache allows more thorough checking with the same
memory budget.

This has no effect on performance because everything ends up in the child
cache created by VerifyDB itself.

It has bugged me ever since #4675, which effectively reduced the
number of checked blocks to reduce peak memory usage.

- Pass the coinsview to use as argument to VerifyDB

- This also avoids that the first `pcoinsTip->Flush()` after VerifyDB
  writes a large slew of unchanged coin records back to the database.
2014-08-27 09:20:33 +02:00