Commit Graph

2304 Commits

Author SHA1 Message Date
David Hill
baef004efd Document limitfreerelay and norelaypriority options. 2016-05-11 13:28:30 -05:00
David Hill
b0255e0eb5 Use NewMsgInvSizeHint when we know the size.
When trickling inv's to peers, allocate for the number of inv's
in the queue instead of the default 1000.  This should save on
memory.
2016-05-11 13:06:11 -05:00
David Hill
83f42be247 Support getmempoolinfo. 2016-05-11 12:27:37 -05:00
John C. Vernaleo
2aec09354a Bump for v0.1.3 2016-05-10 08:49:02 -04:00
C Jepson
b3b20f55bb Fix createrawssrtx command and logic (#159)
The createrawssrtx could not produce correctly formed revocations.
The code has been corrected to call the correct internal API. A
new 'fee' option was added to the JSON command to add a fee to the
revocation.
2016-05-09 11:28:37 -05:00
C Jepson
3001a66ad0 Add transaction type to listtransactions result (#158) 2016-05-09 10:41:38 -05:00
C Jepson
1b8c661be0 Fix resyncing the ticket database after unexpected shutdown (#157)
The ticket database would restore from the genesis block if it failed
the check to see if the tip matched with the database best block. This
corrects the resyncing such that if it finds a matching block for the
ticket database top block in the database, it instead resyncs from that
block instead of the genesis block.
2016-05-06 08:11:52 -05:00
David Hill
7701a7ab63 dcrd: handle signal SIGTERM (#688) (#156)
When an OS reboots or shuts down, it sends all processes SIGTERM before
sending SIGKILL.  This allows dcrd to do a proper shutdown which most
importantly closes the databases.
2016-05-06 08:11:35 -05:00
David Hill
0b6f8817e7 mempool: convert orphansByPrev from a list to a map.
This is more efficient and prevents duplicate entries which can
lead to no-longer-orphans being attempted be added to the mempool
multiple times.

Bug found by me, debugged with @davecgh, and patch from @davecgh
2016-05-05 16:17:33 -04:00
David Hill
85835a3e1f mempool: Have ProcessTransaction return accepted transactions. (#547)
It is not the responsibility of mempool to relay transactions, so
return a slice of transactions accepted to the mempool due to the
passed transaction to the caller.
2016-05-05 16:17:33 -04:00
C Jepson
65999dc171 Reject too low stake difficulty transactions and cache difficulty (#154)
The mempool would allow low stake difficulty tickets and then remove
them after the next block was added. This prevents too low difficulty
tickets from being added in the first place. It also refactors some of
the old code in mempool.go, blockmanager.go, and mining.go for
efficiency.
2016-05-05 15:16:09 -05:00
Alex Yocom-Piatt
e33e2b959d mempool: reduce lock contention (#152)
Previously mp.lastUpdated = time.Now() needed a lock for acess.  With
the use of atomic.StoreInt64, it allows us to remove the lock in
LastUpdated which now can be run in mempool.

Recreated 907152cef9 commit from btcd
2016-05-05 11:31:37 -05:00
John C. Vernaleo
f93cb9fd9f Bump for v0.1.2 2016-05-03 14:48:42 -04:00
C Jepson
084edf8e8b Add the constructor for AddTicketCmd (#148) 2016-05-03 13:41:21 -05:00
Alex Yocom-Piatt
14c7cc99d6 Move non-mempool specific functions to new file. (#140)
No functional change. Add tests.

Conflicts:
	mempool.go
2016-05-02 15:47:14 -05:00
C Jepson
f1796b045d Add stakepooluserinfo and addticket RPC handling (#144)
JSON handling for two new legacy RPC functions designed to aid wallets
running stake pools, stakepooluserinfo and addticket, have been added.
2016-05-02 13:58:51 -05:00
raedah
5623458a66 fix sample config per issue 116 2016-05-01 09:46:23 -07:00
C Jepson
29f116c5da Add ticketvwap and txfeeinfo RPC server commands (#145)
Two new commands were added to the daemon RPC server. They are:

ticketvwap: Calculate the volume weighted average price of tickets.
txfeeinfo: Get the transaction fee information for regular transactions
  in blocks, the mempool, and a height range

The previous "ticketfeeinfo" command logic was also refactored for
portability.
2016-04-29 17:13:47 -05:00
C Jepson
7fd213b993 Add estimatestakediff RPC command (#143)
The new RPC command estimatestakediff was added. It estimates the
minimum, maximum, and expected next stake difficulty. The caller can
also estimate a new difficulty given a passed number of tickets to be
mined in the remaining difficulty period.
2016-04-28 21:19:12 -05:00
Alex Yocom-Piatt
c9a0afa96c Remove magic number and add const maxRelayFeeMultiplier (#139) 2016-04-28 14:45:38 -05:00
Alex Yocom-Piatt
8207e4d228 Add GetStakeDifficultyResult so we can have current and next returned 2016-04-28 11:43:57 -05:00
C Jepson
432873692b Fix mempool fees variables (#141)
The old variables in the memory pool would incorrectly
eliminate transactions send over sendrawtransaction that
had high fees while also always rejecting high priority
transactions. The minimum relay fee has been reinstated,
while the threshold fee now correctly refers to tickets.
2016-04-28 09:12:20 -05:00
John C. Vernaleo
4f8ad739a2 Bump for v0.1.1 2016-04-25 13:03:36 -04:00
C Jepson
41abd20335 Add ticketfeeinfo command (#132)
* Add ticketfeeinfo command

The new RPC command ticketfeeinfo has been added. It provides
statistical information about ticket fees per kilobyte for the
mempool, recent blocks, and recent difficulty windows.
2016-04-21 15:37:16 -05:00
Alex Yocom-Piatt
b7e88f4317 Add new allowHighFees bool arg to ProcessTransaction.
AllowHighFee (default to false) in sendrawtransaction will protect
the user from accidentally sending out fees with unreasonably high
fee/kb tx.  We have decided that 100x times min relay fee/kb is a
sensible upper limit for this check.  But if people choice to force
through tx they can always set this flag to true and the check will
be removed.
2016-04-20 15:42:09 -05:00
Alex Yocom-Piatt
a5ca12f374 Replace float64 and use int64 for feePerKB calculcation
Change calcMinRequiredTxRelay fee to take fee/kb as an arg

This lets us to always compare int fees to fees and not
have to calculate the tx's fee/kb just to compare to the threshold
2016-04-20 13:10:05 -05:00
jolan
fd402439b2 fix typo 2016-04-20 09:54:15 -05:00
cjepson
82a0e17be9 Catch missed error checks 2016-04-19 18:51:59 -04:00
John C. Vernaleo
a33985293b Bump for v0.1.0 (#123) 2016-04-18 16:33:44 -04:00
C Jepson
ca8935f753 Modify the purchaseticket RPC command (#121)
The purchaseticket RPC command has been modified to add the new fields
now used by wallet.
2016-04-18 16:04:01 -04:00
Alex Yocom-Piatt
9559b0a70c Check to see if missingParents != nil which means isOrphan (#122) 2016-04-18 12:33:32 -04:00
cjepson
678b454ede Display ticket commitments in getrawtransaction
Ticket commitments (address and amount) are not properly displayed
by getrawtransaction verbose requests. Now they are part of the
pkScript JSON object.
2016-04-14 13:55:50 -04:00
C Jepson
b75a280a0a Properly handle attempting reorganization to an eligible block (#117)
A continue statement was missing which could cause an issue when
attempting to iterate through different eligible blocks on the chain
tip to mine off of. The mining code was also amended to make it return
newly generated work later on in the code if for some reason not
enough voters were found, instead of just returning a nil template.
2016-04-14 09:54:41 -04:00
Julian Yap
5c791721d6 Fix rpclisten and listen port references in documentation 2016-04-13 23:07:35 -10:00
cjepson
2ba4225eb7 Fix the mining transaction selection algorithm
The mining transaction selection algorithm failed to sort the stake
transactions effectively, as well as failed to sorted by fee for
these transactions. The codebase now defaults to a smaller priority
size spacing in the block, correctly sorts transactions by their stake
importance, and sub-sorts tickets by fees in all cases.
2016-04-13 17:54:06 -04:00
Dan.. Noyes
851569f14e Updated config to allow the ability to change the home directory (#109)
Can use -A or --appdata to change the directory for dcrd to store files.
2016-04-13 15:29:26 -04:00
Alex Yocom-Piatt
936b379408 Update min relay fee calculation to match btcd calc
Plucked from this btcd commit:
489ba8d31d

Would have been cherry-picked but changes with policy.go prevent that
for now
2016-04-12 14:17:24 -05:00
Alex Yocom-Piatt
24591713b4 Clean up and fix fallthrough on invalid tx types
Fixes #110
2016-04-12 15:08:25 +00:00
Dave Collins
073d412d32 TravisCI: Remove external go vet reference. (#655)
The vet tool moved into the Go source tree as of Go 1.5.  Its previous
location in the x/tools repo was deprecated at that time and has now
been removed.

This commit updates the .travis.yml configuration to avoid fetching vet
from the old location and to simply use the version now available as
part of the standard Go install.

Also, while here, remove the check for changing the tool path since it
is no longer needed.
2016-04-07 16:10:52 -04:00
cjepson
0119cd6b1e Fix the constructors for new RPC account commands 2016-04-07 11:24:18 -04:00
cjepson
5658c503c3 Add new JSON handling for RPC commands and livetickets command
New JSON handling has been added for the following wallet commands:
  accountaddressindex
  accountfetchaddresses
  accountsyncaddressindex
  getwalletinfo

getmasterpubkey has been modified to take an account argument.

The new daemon command livetickets has been added. This command dumps
the hashes for all the live tickets in the live ticket stake database.

The new daemon command existsaddresses has been added. This command
takes a JSON array of addresses represented as strings and returns a
bitset indicating whether or not the addresses are used on the block
chain or mempool.
2016-04-06 14:25:38 -04:00
John C. Vernaleo
1517aaad07 Bump for v0.0.10 2016-04-05 15:47:29 -04:00
Dave Collins
fcaaa94d38 Introduce a new utility to show dev premine taint.
This introduces a new utility named checkdevpremine which can be used to
test transactions to determine whether or not they have inputs that
trace back to the original dev premine coins.
2016-04-04 22:00:19 -05:00
John C. Vernaleo
0ed0e815b0 Bump to v0.0.9 for release. 2016-04-01 12:56:01 -04:00
Dave Collins
7a15800bb6 peer: Remove extraneous hasTimestamp check.
The upstream project didn't have timestamps in address messages until
a certain protocol version, however that doesn't apply to Decred.  As a
result, it looks like the check for it was updated to just hard code it to
true.  This was accurate, but there is no point in setting something to
true and then turn around and check if it's true one line later.

Consequently, this just removes the check altogether.
2016-03-25 20:52:07 -05:00
John C. Vernaleo
22298d48a3 Get travis-ci to work again.
Update go versions used.

Run go install before go clean.
2016-03-24 15:26:54 -04:00
David Hill
5fcef8aa56 txscript: New function IsUnspendable
IsUnspendable takes a public key script and returns whether it is
spendable.

Additionally, hook this into the mempool isDust function, since
unspendable outputs can't be spent.

This mimics Bitcoin Core commit 0aad1f13b2430165062bf9436036c1222a8724da
2016-03-22 11:34:32 -04:00
John C. Vernaleo
967952c7cb Bump for 0.0.8 2016-03-18 14:26:05 -04:00
Alex Yocom-Piatt
f89af0d9ae Add rpc json for new set/getbalancetomaintain command 2016-03-18 11:56:16 -05:00
John C. Vernaleo
9f90be7f8f Fix minor goclean issues.
Correct a comment.

Add help text for getticketpoolvalue.
2016-03-18 11:44:11 -04:00