Commit Graph

2569 Commits

Author SHA1 Message Date
Alex Yocom-Piatt
ef83145805 add more checkpoints for upcoming release (#329) (#338) 2016-09-02 17:13:24 -04:00
John C. Vernaleo
617f9a6500 Bump for v0.4.0 2016-09-01 07:41:03 -04:00
Alex Yocom-Piatt
431770d26d Use correct r.err in dcrdLog.Errorf msg (#333) (#334) 2016-08-31 10:26:41 -05:00
Josh Rickmar
0d8104b2cf Add pipes for parent process IPC. (#332)
Rewrite startup/shutdown logic to simplify shutdown signaling.  All
cleanup is now run from deferred functions in the main function.

Add two new config options to set the read and write ends of a pair of
pipes.  This is used as a simple mechanism for a parent process to
communicate with, observe, and manage the lifetime of a child dcrd
process.  When the RX (read end) pipe is closed, clean shutdown
automatically begins.

Add a new flag --lifetimeevents to create and send lifetime event
notifications over the TX (write end) pipe during bringup and
shutdown.  This allows the parent process to observe which subsystems
are currently starting, running, and stopping.

Fixes #297.
Fixes #298.
2016-08-31 10:51:56 -04:00
David Hill
0a9a0f1969 travis: Add go 1.7 and drop go 1.5 support. (#318) 2016-08-17 17:01:03 -04:00
David Hill
3c9995dd4a dcrd: Do not send a wakeup if not sleeping (#314)
A simple printf shows dozens of AfterFuncs being generated, especially
on testnet where the connectable node count is currently low.  By
resetting the timer, it prevents needless wakeups from filling the
channel.
2016-08-15 12:49:13 -05:00
Josh Rickmar
145065c87f Create appdata directory before writing config. 2016-08-11 12:55:46 -04:00
John C. Vernaleo
864b4d34b9 Bump for v0.3.0 2016-08-10 15:11:49 -04:00
Javed Khan
7401db6098 rpcserver: searchrawtx - update coinbase output (#299) 2016-08-10 11:53:00 -05:00
jolan
5f80cf9279 add another mainnet checkpoint, add initial testnet checkpoints (#307) 2016-08-09 14:23:35 -05:00
David Hill
696dcddb23 Return from syncMiningStateAfterSync if peer disconnected. (#310)
Before this fix, if a peer disconnected before the chain was marked
current, its goroutine and memory would hang around until the chain
was marked current.  This would cause out-of-memory errors.

This should also speed up blockchain processing since there are
no longer many goroutines calling IsCurrent every 3 seconds.
2016-08-09 13:59:46 -05:00
C Jepson
61dfe146a9 Fix the coin supply calculation (#309)
* Fix the coin supply calculation

The coin supply calculation was inaccurate. It has been fixed to
exactly calculate the coin supply based on the history of the
blockchain.

* Final block exception

* <=
2016-08-09 13:40:29 -05:00
David Hill
35a103d454 blockmanager: current() for testnet should check blockchain timesource. (#302) 2016-08-09 12:10:13 -05:00
John C. Vernaleo
bcca98d50a Remove --addrindex option.
addrindex does not currently work so do not allow it as an option.
The code for it is still currently there, but no longer hooked in
to something users can set.

Closes #282
2016-08-08 15:13:05 -04:00
David Hill
9069906139 dcrctl: fix reading from stdin in terminal mode (#294)
Fixes #77
2016-08-03 16:19:54 -04:00
Javed Khan
7feb573059 rpcserver: Account for block votes in coin supply (#296) 2016-08-02 14:54:31 -05:00
Alex Yocom-Piatt
83110a26ab Major update to home README (#278) 2016-07-27 13:38:58 -05:00
John C. Vernaleo
7716a500fd Bump version to v0.2.0 2016-07-22 11:22:12 -04:00
C Jepson
525770d48a Attempt to fix the broken paths in config autogen (#290)
The configuration autogenerator currently does not work well
and tries to read the sample file based on where the compiled
source's data directory was. This has been fixed so that dcrd
only checks the %PROGRAMFILES% directory on Windows where the
sample configuration file might be stored. Configuration
autogeneration has been disabled for toehr operating systems.
2016-07-20 13:17:20 -05:00
Alex Yocom-Piatt
b88cf9e80c Remove help fallthrough so help will get passed to RPC (#275)
Fixes #42
2016-07-20 11:47:01 -05:00
Marco Peereboom
4ea1c0f16b glide man 2016-07-15 15:46:43 -05:00
Dave Collins
67a1137109 Add automatic RPC configuration. (#287)
This commit is being cherry-picked from upstream btcd and has been
modified to integrate with dcrd by Dave Collins.
2016-07-15 14:09:42 -04:00
Alex Yocom-Piatt
9146525767 [dcrctl] Clear terminal history (#276)
Fixes #166 and Fixes #104
2016-07-08 11:09:53 -05:00
Alex Yocom-Piatt
3285b88ce3 docs: Add/update doc.go in a few spots (#277) 2016-07-08 11:09:32 -05:00
Alex Yocom-Piatt
3d6d9f1da0 Add BlockHeight field to getstakeinfo (#274) 2016-06-28 10:14:48 -05:00
David Hill
fee17a1a76 Quit when the specified configuration is file not found. (#273)
Also, error on an invalid rpc certificate.
2016-06-27 14:00:48 -05:00
Marco Peereboom
e6beeb689b add simnet to config file (#272) 2016-06-15 17:25:21 -04:00
John C. Vernaleo
927932170b Bump for v0.1.6 2016-06-13 16:23:39 -04:00
Marco Peereboom
fa72e214db Don't create .dcrd willy-nilly.
This interferes with the installer when it tries to detect if the
required .dirs already exist or not.

Debated with jrick and ay-p.
2016-06-09 11:25:33 -05:00
Alex Yocom-Piatt
2bbfd5f250 fix memory allignment for 32-bit architectures (#668) (#269)
having 3 int32s above the uint64s in the struct
will cause misalignment for some 32-bit architectures.
see https://golang.org/pkg/sync/atomic/#pkg-note-BUG
This aligns bytesReceived and bytesSent.
2016-06-08 08:07:22 -05:00
Dave Collins
92635a475e stake: New package for fast access to live tickets. (#266)
Ticket voting selection and validation require fast access to a
lexicographically sorted list of all available tickets.  The current
implementation stores these tickets in bucketized maps which are
unordered.  This means the data has to be sorted every time it is needed
in order to select a ticket and validate a block.  On my hardware, the
process of removing tickets that have been voted and adding new tickets
takes ~27ms with the current implementation.

In order to speed this up, this introduces a new internal package named
tickettreap that provides a tailored treap data structure that is
intended to be used for the in-memory live ticket pool when the new
database and blockchain enhancements have been synced from upstream.
Since it maintains the data in sorted order, it provides a significant
speedup over the current map-based implementation.  On my hardware, this
implementation is able to remove the tickets that have voted and add the
new tickets in ~0.083ms and iterate the entire structure for selecting the
tickets in ~1.88ms for a total of ~1.96ms.  That equates to roughly 14x
faster access.

In addition, it would also be possible for the stake code to keep a map
for height-based lookups (while still relying on this new data structure
for keeping the lexicographic sort ordering requirements) for an even
greater speedup since it would eliminate the need to iterate the
structure to remove tickets at a given height.

Finally, when evaluating forks, the current code is quite inefficient
because it needs to make a copy of all of the live ticket maps.  This
new structure provides O(1) snapshot/copy capabilities so it is much
more efficient in that regard as well.

Benchmarks:

ImmutableCopy     30000000      40.7 ns/op   0 B/op   0 allocs/op
ImmutableIterate  1000       1881738 ns/op   0 B/op   0 allocs/op
2016-06-06 14:33:17 -05:00
John C. Vernaleo
b869593789 Bump for v0.1.5 2016-06-06 14:34:47 -04:00
C Jepson
eda86f5267 Asynchronously call TicketPoolValue to stop block manager blocking (#265) 2016-06-03 15:13:47 -05:00
C Jepson
63fc4e7991 Add rescan and scanfrom options to importprivkey and importscript (#267) 2016-06-03 15:05:09 -05:00
Alex Yocom-Piatt
164f67787b Change Vin field AmountIn to display coins not int64 (#238)
Fixes #184
2016-06-01 16:04:10 -05:00
Jonathan Chappelow
33bcf33872 Fix median of slice of Amounts for ticketfeeinfo. (#239)
* Fix median of slice of Amounts for ticketfeeinfo.

The median function was not operating on a sorted array, so the
result was a random transaction. The modified function sorts
the slice, so a copy may be needed.
2016-06-01 16:00:57 -05:00
cjepson
e47d83cac3 Log block processing time in CHAN with debug on 2016-06-01 16:16:58 -04:00
Dave Collins
157d1cd20b mempool: Create and use mempoolPolicy.
Upstream commit 123ff368f4.

NOTE: This does not separate the new Decred-specific mempool
policy-related variables into the new policy structure.  That needs to
be done as a separate pull request.
2016-06-01 14:58:23 -05:00
Dave Collins
9b3e7d70ef txscript: Correct comments on alt stack methods.
Upstream commit 5ff5fc5fa2.
2016-06-01 14:57:09 -05:00
Dave Collins
848d9fc6cd chaincfg: Consolidate tests into the chaincfg pkg.
Upstream commit 1d83cd5721.
2016-06-01 14:39:12 -05:00
Dave Collins
d6ac2f0fd1 chaincfg: Register networks instead of hard coding.
Upstream commit c7e5d56b58.
2016-06-01 14:34:02 -05:00
Dave Collins
c21db7afba server: Optimize map limiting in block manager.
Upstream commit 23f59144c7.
2016-06-01 13:28:28 -05:00
Dave Collins
2ad0b1aa4c mining: Export block template fields.
Upstream commit a3fa066745.

Also updates all of the new references for the newly exported fields as
part of the merge commit.
2016-06-01 13:25:58 -05:00
Dave Collins
51250786c6 Keep track of recently rejected transactions.
Upstream commit cab74feb59.
2016-06-01 13:17:53 -05:00
Dave Collins
4e878a85fd config: New option --blocksonly
Upstream commit d1e493f4ee.

Since Decred has supported the ability to disable transaction relaying
since the first version, this removes the additional checks which dealt
with only disconnecting peers that were at a high enough protocol
version to always disconnect when peers are announcing transactions when
they were instructed not to.
2016-05-30 14:31:13 -05:00
Dave Collins
16a5842efb server: Cleanup and optimize handleBroadcastMsg.
Contains the following upstream commits:
- 69839adc1c
  - This commit has already been cherry-picked so it is a NOOP
- 7b31349023
2016-05-30 14:09:08 -05:00
Dave Collins
208eaba692 peer: Implement sendheaders support (BIP0130).
Upstream commit 8a58f8cf3a.

Modified the supported protocol version passed to peer to
wire.BIP0111Version which is the version in Decred just before the new
protocol version for wire.SendHeadersVersion.
2016-05-30 14:05:02 -05:00
Dave Collins
6febb7b244 peer: declare QueueMessage()'s doneChan as send only.
Contains the following upstream commits:
- e08038115b
  - This commit has already been cherry-picked so it is a NOOP
- 391d5e4a01
  - This commit has been replaced by a new commit that was cherry-picked
    so it has been converted to a NOOP
- c1861bc8fa
2016-05-30 13:41:36 -05:00
Dave Collins
8a9956da04 docs: Update READMEs with some current details.
Upstream commit 37938375dc.
2016-05-30 13:28:17 -05:00
Dave Collins
70f6de84e5 server: Appropriately name inbound peers map in peerState.
Upstream commit 5c59b685e6.
2016-05-30 12:42:51 -05:00