Commit Graph

5946 Commits

Author SHA1 Message Date
Jonas Schnelli f581d3d656 banlist.dat: store banlist on disk 2015-07-02 20:29:36 +02:00
Wladimir J. van der Laan d6db1157bc
Merge pull request #6362
72b9452 When processing RPC commands during warmup phase, parse the request object before returning an error so that id value can be used in the response. (Forrest Voight)
2015-07-02 20:09:28 +02:00
Wladimir J. van der Laan d7ada03b8a
Merge pull request #6361
4716267 Use real number of cores for default -par, ignore virtual cores (Wladimir J. van der Laan)
2015-07-02 20:01:04 +02:00
Wladimir J. van der Laan 3203a0832a
Merge pull request #5881
5d34e16 Add txn_clone.py test (Tom Harding)
defd2d5 Better txn_doublespend.py test (Tom Harding)
b2b3619 Implement CTransaction::IsEquivalentTo(...) (Tom Harding)
2015-07-02 19:59:50 +02:00
Wladimir J. van der Laan 987efae1fd
Merge pull request #6133
e617fe2 Fix various warnings (Luke Dashjr)
2015-07-02 19:54:12 +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
Forrest Voight 72b9452b1d When processing RPC commands during warmup phase, parse the
request object before returning an error so that id value can
be used in the response.

Prior to this commit, RPC commands sent during Bitcoin's
warmup/startup phase were responded to with a JSON-RPC error
with an id of null, which violated the JSON-RPC 2.0 spec:

id: This member is REQUIRED. It MUST be the same as the value
of the id member in the Request Object. If there was an error
in detecting the id in the Request object (e.g. Parse
error/Invalid Request), it MUST be Null.
2015-07-01 21:55:08 -04:00
Wladimir J. van der Laan 6bcb0a21c5
Merge pull request #6353
5ed1079 Show softfork status in getblockchaininfo (Wladimir J. van der Laan)
2015-07-01 19:37:24 +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 47162673c7 Use real number of cores for default -par, ignore virtual cores
To determine the default for `-par`, the number of script verification
threads, use [boost:🧵:physical_concurrency()](http://www.boost.org/doc/libs/1_58_0/doc/html/thread/thread_management.html#thread.thread_management.thread.physical_concurrency)
which counts only physical cores, not virtual cores.

Virtual cores are roughly a set of cached registers to avoid context
switches while threading, they cannot actually perform work, so spawning
a verification thread for them could even reduce efficiency and will put
undue load on the system.

Should fix issue #6358, as well as some other reported system overload
issues, especially on Intel processors.

The function was only introduced in boost 1.56, so provide a utility
function `GetNumCores` to fall back for older Boost versions.
2015-07-01 18:01:16 +02:00
Jonas Schnelli a7b9623d18 miner: rename UpdateRequestCount signal to ResetRequestCount 2015-07-01 16:09:58 +02:00
Jonas Schnelli 5496253966 add CReserveScript to allow modular script keeping/returning
- use one CReserveScript per mining thread
2015-07-01 16:06:14 +02:00
Jonas Schnelli 087e65def9 fix GetScriptForMining() CReserveKey::keepKey() issue 2015-06-30 21:45:46 +02:00
Jonas Schnelli d0fc10a844 detach wallet from miner 2015-06-30 21:45:46 +02:00
Wladimir J. van der Laan 0564c5b795
Merge pull request #6337
6a4b97e Testing infrastructure: mocktime fixes (Gavin Andresen)
2015-06-29 16:41:29 +02:00
Luke Dashjr 9238ecb417 Policy: MOVEONLY: 3 functions to policy.o:
- [script/standard.o] IsStandard
- [main.o] IsStandardTx
- [main.o] AreInputsStandard

Also, don't use namespace std in policy.cpp
2015-06-26 17:59:10 +02:00
Jorge Timón 627b9deff4 Policy: MOVEONLY: Create policy/policy.h with some constants 2015-06-26 17:59:07 +02:00
Wladimir J. van der Laan 24f24896d6
Merge pull request #6299
4f40716 test: Move reindex test to standard tests (Wladimir J. van der Laan)
36c97b4 Bugfix: Don't check the genesis block header before accepting it (Jorge Timón)
2015-06-26 15:40:59 +02:00
Wladimir J. van der Laan 41076aad0c
Merge pull request #6124
ffd75ad Enable CHECKLOCKTIMEVERIFY as a standard script verify flag (Peter Todd)
bc60b2b Replace NOP2 with CHECKLOCKTIMEVERIFY (BIP65) (Peter Todd)
48e9c57 Move LOCKTIME_THRESHOLD to src/script/script.h (Peter Todd)
99088d6 Make CScriptNum() take nMaxNumSize as an argument (Peter Todd)
2015-06-26 14:42:45 +02:00
Wladimir J. van der Laan 5aa34c7944
Merge pull request #6333
b932953 Hardcoded seeds update June 2015 (Wladimir J. van der Laan)
884454a contrib: Add port parsing to makeseeds.py (Wladimir J. van der Laan)
ccd4369 contrib: Improvements to hardcoded seeds scripts (Wladimir J. van der Laan)
2015-06-25 17:07:00 +02:00
Wladimir J. van der Laan e34a8acd9f
Merge pull request #6233
3e91433 Advance pindexLastCommonBlock for blocks in chainActive (Suhas Daftuar)
2015-06-25 16:36:23 +02:00
Jonas Schnelli 77aeb7c964 UniValue: don't escape solidus, keep espacing of reverse solidus 2015-06-25 08:10:08 +02:00
Wladimir J. van der Laan b9329536cd Hardcoded seeds update June 2015 2015-06-25 08:05:52 +02:00
Gavin Andresen 6a4b97e863
Testing infrastructure: mocktime fixes
New, undocumented-on-purpose -mocktime=timestamp command-line
argument to startup with mocktime set. Needed because
time-related blockchain sanity checks are done on startup, before a
test has a chance to make a setmocktime RPC call.

And changed the setmocktime RPC call so calling it will not result in
currently connected peers being disconnected due to inactivity timeouts.
2015-06-24 15:18:55 -04:00
Wladimir J. van der Laan 91389e51c7
Merge pull request #6088
2085895 fundrawtransaction tests (Jonas Schnelli)
21bbd92 Add fundrawtransaction RPC method (Matt Corallo)
1e0d1a2 Add FundTransaction method to wallet (Matt Corallo)
2d84e22 Small tweaks to CCoinControl for fundrawtransaction (Matt Corallo)
9b4e7d9 Add DummySignatureCreator which just creates zeroed sigs (Pieter Wuille)
2015-06-23 12:40:00 +02:00
Luke Dashjr e617fe2578 Fix various warnings
Found while building on Debian 7
2015-06-23 08:39:57 +00:00
Peter Todd ffd75adce0
Enable CHECKLOCKTIMEVERIFY as a standard script verify flag
Transactions that fail CLTV verification will be rejected from the
mempool, making it easy to test the feature. However blocks containing
"invalid" CLTV-using transactions will still be accepted; this is *not*
the soft-fork required to actually enable CLTV for production use.
2015-06-22 00:00:48 -04:00
Peter Todd bc60b2b4b4 Replace NOP2 with CHECKLOCKTIMEVERIFY (BIP65)
<nLockTime> CHECKLOCKTIMEVERIFY -> <nLockTime>

Fails if tx.nLockTime < nLockTime, allowing the funds in a txout to be
locked until some block height or block time in the future is reached.

Only the logic and unittests are implemented; this commit does not have
any actual soft-fork logic in it.

Thanks to Pieter Wuille for rebase.

Credit goes to Gregory Maxwell for the suggestion of comparing the
argument against the transaction nLockTime rather than the current
time/blockheight directly.
2015-06-21 23:56:28 -04:00
Wladimir J. van der Laan b6668209aa build: Remove -DBOOST_SPIRIT_THREADSAFE
Now that boost spirit is no longer used, `-DBOOST_SPIRIT_THREADSAFE`
doesn't need to be passed to the compiler anymore.
2015-06-21 14:09:34 +02:00
Jorge Timón 36c97b4e5d Bugfix: Don't check the genesis block header before accepting it
This fixes an error triggered when running with -reindex after #5975
2015-06-21 01:24:51 +02:00
Wladimir J. van der Laan 247b91449a
Merge pull request #6262
506bae3 Return all available information via validateaddress (dexX7)
2015-06-19 18:30:58 +02:00
Wladimir J. van der Laan 57539884f2
Merge pull request #6290
57092ed rpc: make `gettxoutsettinfo` run lock-free (Wladimir J. van der Laan)
2015-06-19 17:42:50 +02:00
Jonas Schnelli 1c043d5672 fix lock issue for QT node diconnect and RPC disconnectnode 2015-06-19 16:32:22 +02:00
Jonas Schnelli 932687bc10 setban: add IPv6 tests 2015-06-19 13:51:42 +02:00
Jonas Schnelli 62909f68a0 fix missing lock in CNode::ClearBanned() 2015-06-19 13:31:33 +02:00
Wladimir J. van der Laan 40400d53d3
Merge pull request #6272
edbdf88 tests: Extend RPC proxy tests (Wladimir J. van der Laan)
baf0507 Improve proxy initialization (Wladimir J. van der Laan)
2015-06-18 17:53:36 +02:00
Wladimir J. van der Laan 0abfa8a22f
Merge pull request #6158
9d79afe add RPC tests for setban & disconnectnode (Jonas Schnelli)
1f02b80 setban: add RPCErrorCode (Jonas Schnelli)
d624167 fix CSubNet comparison operator (Jonas Schnelli)
4e36e9b setban: rewrite to UniValue, allow absolute bantime (Jonas Schnelli)
3de24d7 rename json field "bannedtill" to "banned_until" (Jonas Schnelli)
433fb1a [RPC] extend setban to allow subnets (Jonas Schnelli)
e8b9347 [net] remove unused return type bool from CNode::Ban() (Jonas Schnelli)
1086ffb [QA] add setban/listbanned/clearbanned tests (Jonas Schnelli)
d930b26 [RPC] add setban/listbanned/clearbanned RPC commands (Jonas Schnelli)
2252fb9 [net] extend core functionallity for ban/unban/listban (Jonas Schnelli)
2015-06-18 16:48:37 +02:00
Jonas Schnelli 1f02b80253 setban: add RPCErrorCode 2015-06-17 21:40:56 +02:00
Jonas Schnelli d624167387 fix CSubNet comparison operator 2015-06-17 21:40:55 +02:00
Jonas Schnelli 4e36e9bcc7 setban: rewrite to UniValue, allow absolute bantime 2015-06-17 21:40:55 +02:00
Jonas Schnelli 3de24d7647 rename json field "bannedtill" to "banned_until" 2015-06-17 21:40:55 +02:00
Jonas Schnelli 433fb1a95d [RPC] extend setban to allow subnets 2015-06-17 21:40:55 +02:00
Jonas Schnelli e8b93473f1 [net] remove unused return type bool from CNode::Ban() 2015-06-17 21:40:55 +02:00
Jonas Schnelli 1086ffba26 [QA] add setban/listbanned/clearbanned tests 2015-06-17 21:40:55 +02:00
Jonas Schnelli d930b26a26 [RPC] add setban/listbanned/clearbanned RPC commands 2015-06-17 21:40:55 +02:00
Jonas Schnelli 2252fb91cd [net] extend core functionallity for ban/unban/listban 2015-06-17 21:40:55 +02:00
Philip Kaufmann 0ce30eaa36 fix crash on shutdown when e.g. changing -txindex and abort action
- fixes #3136
- the problem is related to Boost path and a static initialized internal
  pointer
- using a std::string in CDBEnv::EnvShutdown() prevents the problem
- this removes the boost::filesystem::path path field from CDBEnv
2015-06-16 15:03:50 +02:00
Alex van der Peet 60dbe73016 New RPC command disconnectnode 2015-06-16 14:19:41 +02:00
Wladimir J. van der Laan a903ad7e9c
Merge pull request #6283
26a639e remove using namespace std from addrman.cpp (Philip Kaufmann)
40c592a make CAddrMan::size() return the correct type of size_t (Philip Kaufmann)
2015-06-16 14:06:59 +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
Cory Fields 72bf90d770 Fix scheduler build with some boost versions.
Some boost versions have a conflicting overload of wait_until that returns void.
Explicitly use a template here to avoid hitting that overload.
2015-06-15 16:29:57 -04:00
Philip Kaufmann 26a639e21f remove using namespace std from addrman.cpp 2015-06-15 14:45:19 +02:00
Philip Kaufmann 40c592aa21 make CAddrMan::size() return the correct type of size_t 2015-06-15 14:43:31 +02:00
Wladimir J. van der Laan c1fb0e1075
Merge pull request #6274
02a6702 Add option `-alerts` to opt out of alert system (Wladimir J. van der Laan)
2015-06-15 09:57:33 +02:00
Wladimir J. van der Laan 02a6702a82 Add option `-alerts` to opt out of alert system
Make it possible to opt-out of the centralized alert system by providing
an option `-noalerts` or `-alerts=0`. The default remains unchanged.

This is a gentler form of #6260, in which I went a bit overboard by
removing the alert system completely.

I intend to add this to the GUI options in another pull after this.
2015-06-15 09:53:33 +02:00
Wladimir J. van der Laan 5ebe7db6d0
Merge pull request #6257
ef2a3de Add paytxfee to getwalletinfo, warnings to getnetworkinfo (Stephen)
2015-06-15 09:39:30 +02:00
Josh Lehan e3cae52538 Added -whiteconnections=<n> option
This sets aside a number of connection slots for whitelisted peers,
useful for ensuring your local users and miners can always get in,
even if your limit on inbound connections has already been reached.
2015-06-14 02:07:15 -07:00
Tom Harding 7d6a85ab5b Fix getbalance *
Chance "getbalance *" not to use IsTrusted.  The method and result
now match the "getbalance <specific-account>" behavior. In
particular, "getbalance * 0" now works.

Also fixed a comment -- GetGalance has required 1 confirmation
for many years, and the default "getbalance *" behavior matches
that.
2015-06-12 15:31:01 -07:00
Wladimir J. van der Laan ab0ec67903
Merge pull request #6209
e059726 [Qt] deselect peer when switching away from peers tab in RPC console (Philip Kaufmann)
7211ada [Qt] replace Boost foreach with Qt version peertablemodel.cpp (Philip Kaufmann)
1b0db7b [Qt] extend rpc console peers tab (Philip Kaufmann)
2015-06-12 16:49:53 +02:00
Wladimir J. van der Laan 8ccc07c077
Merge pull request #6256
65b9454 Use best header chain timestamps to detect partitioning (Gavin Andresen)
2015-06-12 16:44:36 +02:00
Wladimir J. van der Laan baf05075fa Improve proxy initialization
Simplify and make the code in AppInit2 more clear.

This provides a straightforward flow, gets rid of .count() (which makes
it possible to override an earlier provided proxy option to nothing), as
well as comments the different cases.
2015-06-12 12:41:44 +02:00
Wladimir J. van der Laan ebab5d3c59
Merge pull request #6266
0cc7b23 Fix univalue handling of \u0000 characters. (Daniel Kraft)
2015-06-12 09:15:26 +02:00
Stephen ef2a3de25c Add paytxfee to getwalletinfo, warnings to getnetworkinfo 2015-06-11 16:12:34 -04:00
Wladimir J. van der Laan dd8fe8215a
Merge pull request #6221
c257a8c Prune: Support noncontiguous block files (Adam Weiss)
2015-06-11 18:24:35 +02:00
Daniel Kraft 0cc7b2352e Fix univalue handling of \u0000 characters.
Univalue's parsing of \u escape sequences did not handle NUL characters
correctly.  They were, effectively, dropped.  The extended test-case
fails with the old code, and is fixed with this patch.
2015-06-11 12:09:05 +02:00
Wladimir J. van der Laan 51870fc151
Merge pull request #6264
9b5659d Remove translation for -help-debug options (Wladimir J. van der Laan)
2015-06-11 10:50:01 +02:00
Matt Corallo 21bbd920e5 Add fundrawtransaction RPC method 2015-06-11 01:03:23 -07:00
Matt Corallo 1e0d1a2ff0 Add FundTransaction method to wallet
Some code stolen from Jonas Schnelli <jonas.schnelli@include7.ch>
2015-06-11 01:03:23 -07:00
Matt Corallo 2d84e22703 Small tweaks to CCoinControl for fundrawtransaction 2015-06-11 01:03:23 -07:00
Pieter Wuille 9b4e7d9a5e Add DummySignatureCreator which just creates zeroed sigs 2015-06-11 01:03:23 -07:00
Philip Kaufmann e059726811 [Qt] deselect peer when switching away from peers tab in RPC console 2015-06-11 08:39:08 +02:00
Philip Kaufmann 7211adad85 [Qt] replace Boost foreach with Qt version peertablemodel.cpp 2015-06-11 08:38:02 +02:00
Philip Kaufmann 1b0db7b984 [Qt] extend rpc console peers tab
- add node id, ping wait, whitelisted and common height
- rephrase some labels to make them easier to understand for users
2015-06-11 08:38:01 +02:00
Wladimir J. van der Laan eba2f061a0
Merge pull request #6061
eb83719 Consensus: Refactor: Separate Consensus::CheckTxInputs and GetSpendHeight in CheckInputs (Jorge Timón)
2015-06-10 18:04:38 +02:00
Jorge Timón eb837199a0 Consensus: Refactor: Separate Consensus::CheckTxInputs and GetSpendHeight in CheckInputs 2015-06-10 14:07:30 +02:00
Jorge Timón 425c3a87ff Consensus: Separate CheckIndexAgainstCheckpoint() from ContextualCheckBlockHeader 2015-06-10 13:04:50 +02:00
Wladimir J. van der Laan ac5476e2c1
Merge pull request #6057
7e6569e [squashme] improve/corrects prune mode detection test for required wallet rescans (Jonas Schnelli)
7a12119 [RPC] disable import functions in pruned mode (Jonas Schnelli)
3201035 [autoprune] allow wallet in pruned mode (Jonas Schnelli)
2015-06-10 12:32:31 +02:00
Wladimir J. van der Laan 3a1d3e8f52
Merge pull request #5985
14d4eef Fix removing of orphan transactions (Alex Morcos)
2015-06-10 12:15:19 +02:00
Wladimir J. van der Laan 9b5659d1c4 Remove translation for -help-debug options
Do not translate -help-debug options, Many technical terms, and
only a very small audience, so is unnecessary stress to translators.

Brings the code up to date with translation string policy in
`doc/translation_strings_policy.md`.

Also remove no-longer-relevant "In this mode -genproclimit controls how
many blocks are generated immediately." (as of #5957) from regtest help.
2015-06-10 11:59:23 +02:00
Wladimir J. van der Laan e54ff2fc0e
Merge pull request #6213
eebd4cc [init] add -blockversion help and extend -upnp help (Philip Kaufmann)
2015-06-10 11:39:06 +02:00
Wladimir J. van der Laan 8d9f0a6069
Merge pull request #5927
dce8360 Reduce checkpoints' effect on consensus. (Pieter Wuille)
2015-06-10 10:33:12 +02:00
Wladimir J. van der Laan 9c93ee5ceb
Merge pull request #6222
efd4444 Explicitly set tx.nVersion for the genesis block and mining tests (Mark Friedenbach)
2015-06-10 09:48:00 +02:00
Wladimir J. van der Laan 643114f539
Merge pull request #6239
7d8ffac Changes necessary now that zero values accepted in AmountFromValue (Wladimir J. van der Laan)
a04bdef Get rid of fPlus argument to FormatMoney (Wladimir J. van der Laan)
4b4b9a8 Don't go through double in AmountFromValue and ValueFromAmount (Wladimir J. van der Laan)
2015-06-09 18:38:33 +02:00
Wladimir J. van der Laan 3a2ca9bbde
Merge pull request #6246
0640a5e Add an alternate location of endian.h header (Andriy Voskoboinyk)
2015-06-09 18:24:53 +02:00
dexX7 506bae3ac9
Return all available information via validateaddress
`"validateaddress"` omits some information, even in cases where is it available.

The primary motivation is to be able to retrieve redeemScripts, after using `"addmultisigaddress"`, when not all keys are available in the keystore, but the redeemScript actually is.

The output of `"validateaddress"` with this commit:

Keys not available:
```js
validateaddress "n4KWZKx349gdMQGgTnZ8W6WfgSwybkGSK3"
{
  "isvalid": true,
  "address": "n4KWZKx349gdMQGgTnZ8W6WfgSwybkGSK3",
  "scriptPubKey": "76a914fa20d564550b105787f7ce3a9ad7fd9a45cd407088ac",
  "ismine": false,
  "iswatchonly": false,
  "isscript": false
}
```
```js
validateaddress "2N2g2H7gjA8a11g1yKBgh5VTqndyvbnWpBK"
{
  "isvalid": true,
  "address": "2N2g2H7gjA8a11g1yKBgh5VTqndyvbnWpBK",
  "scriptPubKey": "a9146769c19a16c9400b908756e19a4d2afb9e9760e187",
  "ismine": false,
  "iswatchonly": false,
  "isscript": true
}
```

After adding the redeemScript:
```js
addmultisigaddress 2 '["02537357B156A33306A7A014A3748631C59DF405B56F11BA4AA4A3CE81501AF095","02F1FB200390E7864EF4450C07B15988179A57C3CF3A878F668E1070CB615749FE"]'
2N2g2H7gjA8a11g1yKBgh5VTqndyvbnWpBK

validateaddress "2N2g2H7gjA8a11g1yKBgh5VTqndyvbnWpBK"
{
  "isvalid": true,
  "address": "2N2g2H7gjA8a11g1yKBgh5VTqndyvbnWpBK",
  "scriptPubKey": "a9146769c19a16c9400b908756e19a4d2afb9e9760e187",
  "ismine": false,
  "iswatchonly": false,
  "isscript": true,
  "script": "multisig",
  "hex": "522102537357b156a33306a7a014a3748631c59df405b56f11ba4aa4a3ce81501af0952102f1fb200390e7864ef4450c07b15988179a57c3cf3a878f668e1070cb615749fe52ae",
  "addresses": [
    "n4KWZKx349gdMQGgTnZ8W6WfgSwybkGSK3",
    "mmSKNtbYYHRrhTLKiok5TuYrGEs4Y2A4k6"
  ],
  "sigsrequired": 2,
  "account": ""
}
```

All keys available:
```js
validateaddress "n4KWZKx349gdMQGgTnZ8W6WfgSwybkGSK3"
{
  "isvalid": true,
  "address": "n4KWZKx349gdMQGgTnZ8W6WfgSwybkGSK3",
  "scriptPubKey": "76a914fa20d564550b105787f7ce3a9ad7fd9a45cd407088ac",
  "ismine": true,
  "iswatchonly": false,
  "isscript": false,
  "pubkey": "02537357b156a33306a7a014a3748631c59df405b56f11ba4aa4a3ce81501af095",
  "iscompressed": true,
  "account": ""
}
```
```js
validateaddress "2N2g2H7gjA8a11g1yKBgh5VTqndyvbnWpBK"
{
  "isvalid": true,
  "address": "2N2g2H7gjA8a11g1yKBgh5VTqndyvbnWpBK",
  "scriptPubKey": "a9146769c19a16c9400b908756e19a4d2afb9e9760e187",
  "ismine": true,
  "iswatchonly": false,
  "isscript": true,
  "script": "multisig",
  "hex": "522102537357b156a33306a7a014a3748631c59df405b56f11ba4aa4a3ce81501af0952102f1fb200390e7864ef4450c07b15988179a57c3cf3a878f668e1070cb615749fe52ae",
  "addresses": [
    "n4KWZKx349gdMQGgTnZ8W6WfgSwybkGSK3",
    "mmSKNtbYYHRrhTLKiok5TuYrGEs4Y2A4k6"
  ],
  "sigsrequired": 2,
  "account": ""
}
```
2015-06-09 17:21:27 +02:00
Wladimir J. van der Laan c57e12aeef
Merge pull request #6217
51fc672 [Qt] disconnect peers from peers tab via context menu (Philip Kaufmann)
2015-06-09 17:13:29 +02:00
Gavin Andresen 65b9454503
Use best header chain timestamps to detect partitioning
The partition checking code was using chainActive timestamps
to detect partitioning; with headers-first syncing, it should use
(and with this pull request, does use) pIndexBestHeader timestamps.

Fixes issue #6251
2015-06-08 16:34:58 -04:00
Andriy Voskoboinyk 0640a5eb60 Add an alternate location of endian.h header 2015-06-07 04:54:20 +03:00
Wladimir J. van der Laan 55294a9fb6
Merge pull request #6241
c946ebe fix util_tests.cpp clang warnings (Jonas Schnelli)
2015-06-06 11:31:55 +02:00
Jonas Schnelli c946ebed5e fix util_tests.cpp clang warnings
was introduced with #6121
2015-06-06 10:12:12 +02:00
Wladimir J. van der Laan 7d8ffac186 Changes necessary now that zero values accepted in AmountFromValue
- Add an accept test for zero amounts, and a reject test for negative
  amounts
- Remove ugly hack in `settxfee` that is no longer necessary
- Do explicit zero checks in wallet RPC functions
- Don't add a check for zero amounts in `createrawtransaction` - this
  could be seen as a feature
2015-06-06 09:41:12 +02:00
Wladimir J. van der Laan a04bdefbeb Get rid of fPlus argument to FormatMoney
It's never used with any other value than false, the default.
2015-06-06 09:30:41 +02:00
Wladimir J. van der Laan 4b4b9a8de6 Don't go through double in AmountFromValue and ValueFromAmount
My prime gripe with JSON spirit was that monetary values still had to be
converted from and to floating point which can cause deviations (see #3759
and https://bitcoin.stackexchange.com/questions/22716/bitcoind-sendfrom-round-amount-error).

As UniValue stores internal values as strings, this is no longer
necessary. This avoids risky double-to-integer and integer-to-double
conversions completely, and results in more elegant code to boot.
2015-06-06 09:30:41 +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
Wladimir J. van der Laan 12cdbabc26
Merge pull request #6152
08d9373 Remove unused code from wallet and validation interface (Michael Ford)
2015-06-05 21:24:15 +02:00
Wladimir J. van der Laan 3fce72eaa3
Merge pull request #6206
a9ac95c use const references where appropriate (Philip Kaufmann)
2015-06-05 07:11:44 +02:00
Jonas Schnelli ef5fca8b80 fix rpcmining/getblocktemplate univalue transition logic error 2015-06-04 21:40:11 +02:00
Philip Kaufmann a9ac95c1bc use const references where appropriate 2015-06-04 19:34:18 +02:00
Suhas Daftuar 3e9143386a Advance pindexLastCommonBlock for blocks in chainActive
This prevents an edge case where a block downloaded and pruned
in-between successive calls to FindNextBlocksToDownload could
cause the block to be unnecessarily re-requested.
2015-06-04 13:00:26 -04:00
Jonas Schnelli 44c7474446 univalue: add type check unit tests 2015-06-04 13:58:14 +02:00