645 Commits

Author SHA1 Message Date
Jannis Froese
8826b6bdc4 Make rewards in regtest mode less random
This allows sane testing. Regtest mode is primarily intended for automated
testing, so this simplification makes sense
2014-06-02 21:51:04 +02:00
Gregory Maxwell
5b0ac349e4 Move assert(pindexNew); to above where we dereference pindexNew. 2014-05-26 20:15:04 +02:00
Wladimir J. van der Laan
a8f53a2a28 Fix printblocktree output (bitcoin/bitcoin@af4c2ac8ce) 2014-05-26 18:54:49 +02:00
Pieter Wuille
30f5429536 Per-peer block download tracking and stalled download detection.
Keep track of which block is being requested (and to be requested) from
each peer, and limit the number of blocks in-flight per peer. In addition,
detect stalled downloads, and disconnect if they persist for too long.

This means blocks are never requested twice, and should eliminate duplicate
downloads during synchronization.
2014-05-25 18:56:47 +02:00
Philip Kaufmann
3e0de4da6b minor style cleanups
Conflicts:

	src/main.cpp
2014-05-18 16:50:24 +01:00
langerhans
aecf0170a9 Revert "don't send feeless transactions"
This reverts commit 9a2f7a86fca6e243db7745cb1b15b35ce1b97b2e.
2014-05-04 17:02:08 +02:00
Jannis Froese
9a2f7a86fc don't send feeless transactions 2014-05-01 21:10:19 +02:00
Jannis Froese
5c8ab69b63 refactor GetMinFee to remove dead code 2014-05-01 21:08:26 +02:00
Patrick Lodder
d0957dc745 DRY calculation for required maturity depth
Having this defined in multiple places is suboptimal and may lead
to porting issues, so I extracted it into it's own function and
let both implementations call that instead.
2014-04-20 17:47:11 +04:00
Ross Nicoll
85392ed8bb Added GetHeightInMainChain() method.
Corrected call to GetDepthInMainChain() with GetHeightInMainChain() when checking coin maturity.
2014-04-20 17:47:11 +04:00
Ross Nicoll
e1ce43df71 Corrected block maturity test. 2014-04-20 16:33:36 +04:00
Patrick Lodder
3820347253 removed the "DIGISHIELD RETARGET" message that was spammed in console. 2014-04-14 19:50:52 +04:00
Alan Westbrook
30053cfaa3 Lets get at least dogecoind building
This is an Xcode project and a script to wrangle boost to work on the
mac.
2014-04-05 00:17:09 -07:00
Ross Nicoll
db800dead2
Standardised capitalisation of Dogecoin. 2014-03-31 21:24:02 +01:00
Ross Nicoll
48c6ec9af0 Replaced occurrences of "bitcoin" with "dogecoin" or "Dogecoin" as appropriate
(specific, use of "Dogecoin" as a noun are now capitalised).
2014-03-28 23:40:56 +00:00
Ross Nicoll
3fd42567e8 Replaced references to Bitcoin with Dogecoin/Dogecoin Core as appropriate. 2014-03-28 23:13:24 +00:00
Jannis Froese
1943494138 additional Dogecoin 1.6 changes
(cherry picked from commit 6d46c53acf957e33e3940a8db009cc406a3f6b9c)
2014-03-24 03:28:06 +01:00
Jannis Froese
103a278443 Merge branch 'node-bloom-service-bit' of github.com:petertodd/bitcoin into bloom-todd 2014-03-23 21:25:51 +01:00
Jannis Froese
a4b177d925 credit where credit is due
(cherry picked from commit 5cdcfa9a2b445dd8f8009f6ff3a8ded4ee6515e6)
2014-03-22 22:13:28 +01:00
Jannis Froese
e68d56b2db additional Dogecoin 1.6 protocol change
(cherry picked from commit 650ec89e251e1201479d75f79ac520f278a50c40)
2014-03-22 22:13:28 +01:00
Jannis Froese
c5eb32a85b updated to Dogecoin 1.6 protocol
(cherry picked from commit d6dbaf412e2331426d5012d1c10b7749b6821b82)
2014-03-22 22:13:27 +01:00
Jannis Froese
1bf59137be Protocol changes for Dogecoin 1.5
ported over from Dogecoin and Litecoin

(cherry picked from commit 8b09dad2d506fc5a6239863b1c0e33bf7e84da00)
2014-03-22 22:13:27 +01:00
Mike Hearn
1eedbbb3a6 Make mining fee policy match relay fee policy.
This resolves a case in which a mismatch could be used to bloat up the
mempool by sending transactions that pay enough fee to relay, but not
to be mined, with the default policies.

Rebased-From: 037b4f1
2014-03-11 16:45:54 +01:00
R E Broadley
ff882789af Add progress to initial display of latest block downloaded.
Rebased-From: c4656e0
2014-03-11 09:24:12 +01:00
Gavin Andresen
f60e49d49c Merge pull request #3694 from gavinandresen/vfspent
Remove CWalletTx::vfSpent
2014-02-28 15:16:25 -05:00
Gavin Andresen
e3e65d29b7 Merge pull request #3735 from laanwj/2014_02_remove_PRIx64_completely
Remove PRIx64 usage completely
2014-02-26 12:16:03 -05:00
Gavin Andresen
93a18a3650 Remove CWalletTx::vfSpent
Use the spent outpoint multimap to figure out which wallet transaction
outputs are unspent, instead of a vfSpent array that is saved
to disk.
2014-02-26 11:53:51 -05:00
Jeff Garzik
beabca2be0 Merge pull request #3305 from mikehearn/fee_drop
Drop fees by 10x due to the persistently higher exchange rate.
2014-02-24 14:05:54 -05:00
Wladimir J. van der Laan
f48742c2bf Get rid of C99 PRI?64 usage in source files
Amend to d5f1e72. It turns out that BerkelyDB was including inttypes.h
indirectly, so we cannot fix this with just macros.

Trivial commit: apply the following script to all .cpp and .h files:

    # Middle
    sed -i 's/"PRIx64"/x/g' "$1"
    sed -i 's/"PRIu64"/u/g' "$1"
    sed -i 's/"PRId64"/d/g' "$1"
    # Initial
    sed -i 's/PRIx64"/"x/g' "$1"
    sed -i 's/PRIu64"/"u/g' "$1"
    sed -i 's/PRId64"/"d/g' "$1"
    # Trailing
    sed -i 's/"PRIx64/x"/g' "$1"
    sed -i 's/"PRIu64/u"/g' "$1"
    sed -i 's/"PRId64/d"/g' "$1"

After this commit, `git grep` for PRI.64 should turn up nothing except
the defines in util.h.
2014-02-24 09:08:56 +01:00
Wladimir J. van der Laan
d5f1e727a8 Don't use PRIx64 formatting derives from inttypes.h
As the tinyformat-based formatting system (introduced in b77dfdc) is
type-safe, no special format characters are needed to specify sizes.

Tinyformat can support (ignore) the C99 prefixes such as "ll" but
chokes on MSVC's inttypes.h defines prefixes such as "I64X". So don't
include inttypes.h and define our own for compatibility.

(an alternative would be to sweep the entire codebase using sed -i to
get rid of the size specifiers but this has less diff impact)
2014-02-22 11:36:37 +01:00
Wladimir J. van der Laan
76a77059f3
Merge pull request #2910
d8b4b49 Don't store or send side-chain blocks lower than last checkpoint. (Ashley Holman)
2014-02-20 12:32:32 +01:00
Wladimir J. van der Laan
047ee427e7
Merge pull request #3666
bbfce8a fix non-standard reason string in main.cpp (Philip Kaufmann)
2014-02-17 13:59:50 +01:00
Wladimir J. van der Laan
b8d9058a4d
Merge pull request #3646
5770254 Copyright header updates s/2013/2014 on files whose last git commit was done in 2014. contrib/devtools/fix-copyright-headers.py script to be able to perform this maintenance task with ease during the rest of the year, every year. Modifications to contrib/devtools/README.md to document what fix-copyright-headers.py does. (gubatron)
2014-02-16 11:44:48 +01:00
Gavin Andresen
2b72d46f42 Handle "conflicted" transactions properly
Extend CMerkleTx::GetDepthInMainChain with the concept of
a "conflicted" transaction-- a transaction generated by the wallet
that is not in the main chain or in the mempool, and, therefore,
will likely never be confirmed.

GetDepthInMainChain() now returns -1 for conflicted transactions
(0 for unconfirmed-but-in-the-mempool, and >1 for confirmed).

This makes getbalance, getbalance '*', and listunspent all agree when there are
mutated transactions in the wallet.

Before:
 listunspent: one 49BTC output
 getbalance: 96 BTC (change counted twice)
 getbalance '*': 46 BTC (spends counted twice)

After: all agree, 49 BTC available to spend.
2014-02-14 11:08:40 -05:00
Philip Kaufmann
bbfce8a4c9 fix non-standard reason string in main.cpp 2014-02-13 15:12:18 +01:00
Pieter Wuille
87fe71e1fc Add HasCanonicalPushes(), and use it in IsStandardTx 2014-02-11 21:11:59 +01:00
gubatron
57702541a2 Copyright header updates s/2013/2014 on files whose last git commit was done in 2014.
contrib/devtools/fix-copyright-headers.py script to be able to perform this maintenance task with ease during the rest of the year, every year. Modifications to contrib/devtools/README.md to document what fix-copyright-headers.py does.
2014-02-09 21:06:06 -05:00
Pieter Wuille
bbde1e99c8 Limit the number of orphan blocks
In case the total number of orphan blocks in memory exceeds a limit
(currently set to 750), a random orphan block (which is not
depended on by another orphan block) is dropped. This means it will
need to be downloaded again, but it won't consume memory until then.
2014-01-31 14:16:06 +01:00
Wladimir J. van der Laan
19007cf552
Merge pull request #3592
c117d9e Support for error messages and a few more rejection reasons (Luke Dashjr)
14e7ffc Use standard BIP 22 rejection reasons where applicable (Luke Dashjr)
2014-01-30 16:45:26 +01:00
Gavin Andresen
3581abdd46 Merge pull request #3370 from sipa/headersfirst3
Prepare block connection logic for headers-first
2014-01-29 13:49:15 -08:00
Luke Dashjr
c117d9e93a Support for error messages and a few more rejection reasons 2014-01-29 17:39:24 +00:00
Luke Dashjr
14e7ffcc64 Use standard BIP 22 rejection reasons where applicable 2014-01-29 17:39:18 +00:00
Philip Kaufmann
b34e88a88f use english for all reason strings in IsStandardTx() 2014-01-28 07:45:42 +01:00
Pieter Wuille
75f51f2a63 Prepare block connection logic for headers-first.
This changes the block processing logic from "try to atomically switch
to a new block" to a continuous "(dis)connect a block, aiming for the
assumed best chain".

This means the smallest atomic operations on the chainstate become
individual block connections or disconnections, instead of entire
reorganizations. It may mean that we try to reorganize to one block,
fail, and rereorganize again to the old block. This is slower, but
doesn't require unbounded RAM.

It also means that a ConnectBlock which fails may be no longer called
from the ProcessBlock which knows which node sent it. To deal with that,
a mapBlockSource is kept, and invalid blocks cause asynchronous "reject"
messages and banning (if necessary).
2014-01-27 21:20:41 +01:00
Pieter Wuille
0ec16f35d6 Move only: extract WriteChainState and UpdatedTip from SetBestChain. 2014-01-27 21:13:48 +01:00
Peter Todd
665bdd3bc9
Fix off-by-one errors in use of IsFinalTx()
Previously CreateNewBlock() didn't take into account the fact that
IsFinalTx() without any arguments tests if the transaction is considered
final in the *current* block, when both those functions really needed to
know if the transaction would be final in the *next* block.

Additionally the UI had a similar misunderstanding.

Also adds some basic tests to check that CreateNewBlock() is in fact
mining nLockTime-using transactions correctly.

Thanks to Wladimir J. van der Laan for rebase.
2014-01-26 21:50:15 -05:00
Wladimir J. van der Laan
7d9d134bf9 Remove redundant .c_str()s
After the tinyformat switch sprintf() family functions support passing
actual std::string objects.

Remove unnecessary c_str calls (236 of them) in logging and formatting.
2014-01-23 16:05:01 +01:00
Wladimir J. van der Laan
b77dfdc9e3 Typesafe strprintf/error/LogPrint functions
Switch to tinyformat-based formatting.

Tinyformat is a typesafe drop-in replacement for C99 printf functions:
https://github.com/c42f/tinyformat
2014-01-23 16:05:00 +01:00
Ashley Holman
d8b4b49667 Don't store or send side-chain blocks lower than last checkpoint. 2014-01-19 18:15:38 -06:00
Wladimir J. van der Laan
6c19ca1f92
Merge pull request #3490
7e08e29 better std::exception logging for block/undo files (Philip Kaufmann)
2014-01-18 12:25:05 +01:00