Commit Graph

2291 Commits

Author SHA1 Message Date
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
cjepson
9b37ebdbf9 Add lookup of ticket commitments to addrindex
Ticket commitments to a future address were ignored under the
old code. Now they are deserialized from their pkScripts and
stored in the address index of the database. This corrects some
wallet syncing behaviour where usage of addresses failed to
be determined with existsaddress. This has been tested for
correctness with several simnet blockchains.
2016-03-17 13:46:30 -04:00
cjepson
71837f4674 Add and implement the getticketpoolvalue JSON RPC command
The RPC command getticketpoolvalue has been added. Calling the
command will return the current value of all the locked stake from
tickets in the ticket pool.
2016-03-16 12:43:53 -04:00
Jonathan Zeppettini
c0614fb151 Update configuring_tor.md
Replace Bitcoin with Decred,
2016-03-09 13:50:45 -05:00
cjepson
f2cc01cef2 Bump version for release 2016-03-09 12:11:35 -05:00
cjepson
c017ba6b60 Correct the expected number of inputs for stake P2SH outputs
The required number of inputs for a stake P2SH output were incorrectly
estimated by CalcScriptInfo. Now the sub class for any given output is
also checked for whether or not it is P2SH.
2016-03-09 11:46:16 -05:00
cjepson
df701d8cdf Revert sync merge
The sync merge does not build and needs further testing. It is
being reverted.
2016-03-08 22:16:06 -05:00
Alex Yocom-Piatt
cb9566911c Update comment to match code 2016-03-07 13:39:50 -06:00
Alex Yocom-Piatt
7e2c687295 Fix build/test errors from merge 2016-03-07 11:42:51 -06:00
Alex Yocom-Piatt
5b2b97e858 Sync to upstream 0280fa0264
Conflicts:
	blockchain/chain.go
	blockchain/checkpoints.go
	blockchain/difficulty.go
	blockchain/internal_test.go
	blockchain/txlookup.go
	blockchain/validate.go
	blockchain/validate_test.go
	blockmanager.go
	chaincfg/params.go
	cmd/dropafter/dropafter.go
	cpuminer.go
	database/db.go
	database/interface_test.go
	database/ldb/block.go
	database/ldb/insertremove_test.go
	database/ldb/leveldb.go
	database/ldb/operational_test.go
	database/ldb/tx.go
	database/memdb/memdb.go
	database/reorg_test.go
	dcrjson/walletsvrcmds.go
	docs/README.md
	docs/json_rpc_api.md
	mempool.go
	mining.go
	peer.go
	rpcserver.go
	rpcserverhelp.go
	rpcwebsocket.go
	sample-dcrd.conf
	txscript/consensus.go
	txscript/script_test.go
	txscript/sign.go
	txscript/standard.go
	wire/blockheader_test.go
	wire/msgtx_test.go
2016-03-07 11:35:24 -06:00
cjepson
db3e406e9a Optimize mining checks for various stake transactions
Many of the checks for the type of stake transaction in the main sorting
loop for mempool transactions of NewBlockTemplate were redundant. Now the
cached data for the transaction type is used instead. An expensive lookup
for a transaction cache was also moved for efficiency.
2016-03-04 15:53:37 -05:00
cjepson
20a9d15992 Reduce likelihood of vote spam
It was easy to spam the mempool with vote transactions that could never be
included in blocks. The original parameter for the number of double spent tickets
in the mempool was lax for simulations, but should be decreased to protect
mainnet daemons.
2016-03-04 15:11:34 -05:00
cjepson
e8059bf4f3 Fix storing the ticket database to disk on close
The 'stop' command would fail to store the ticket database on close because
the Store() function was never called. This ensures that it is called on
closing.
2016-03-04 13:43:45 -05:00
John C. Vernaleo
8f0d8f2d85 Update to 0.0.6 for new release. 2016-03-04 13:17:22 -05:00