Commit Graph

2213 Commits

Author SHA1 Message Date
cjepson
cd8ea2e309 Add the new RPC function existsmempooltxs
A new RPC function has been added to the daemon to quickly check for
the existence of transactions in the mempool. It handles raw encoded
hex containing transaction hashes and outputs a raw encoded hex of
bit flags. This makes the output size as small as possible while
speeding up the JSON encoding/decoding of the data.
2016-03-02 11:37:35 -05:00
Jonathan Zeppettini
b237418c14 Update default_ports.md
Small correction, replaced Bitcoin with Decred.
2016-03-01 20:19:57 -05:00
cjepson
95b4e76c1d Add getticketsvotebits batched command for wallet RPC
JSON handling for the new wallet command getticketsvotebits has been
added. A common struct for voteBits data is now also used between
getticketvotebits and getticketsvotebits.
2016-03-01 13:08:08 -05:00
Alex Yocom-Piatt
c1420d93ad Add new RPC handlers for get/setticketfee 2016-02-29 13:52:10 -06:00
cjepson
61dd0bce67 Fix a panic caused by accessing unassigned pointer
This bug was introduced with the fix for checkBlockForHidden votes. One of the
consistency checks fails if the template is uninitialized. The unitialized
pointer is now caught and the function will safely return.
2016-02-29 13:51:16 -05:00
Dave Collins
3a30ba7695 wire: Export var length string serialization funcs.
This commit exports the ReadVarString and WriteVarString functions so
they are available for callers to use.

A variable length string is encoded as a variable length integer
containing the length of the string followed by the bytes that represent
the string itself.
2016-02-29 12:51:36 -05:00
Josh Rickmar
38ff4bbb3c btcjson: Add spendable to listunspent result. 2016-02-29 12:51:36 -05:00
cjepson
af863abadb Bug fix for checkBlockForHiddenVotes corrupting block templates
The checkBlockForHiddenVotes function would corrupt block templates
by incorrectly inserting votes from other blocks. The function has
been rewritten and now correctly regenerates the block template with
the correct number of voters.
2016-02-29 10:43:24 -05:00
cjepson
e318312e80 Fix a copy-paste error in chainsvrcmds.go 2016-02-26 17:50:48 -05:00
John C. Vernaleo
4c24488b8a Fix some missing rpc help.
Caught by go test.
2016-02-26 11:26:47 -05:00
John C. Vernaleo
fbede49780 Update to 0.0.5 for new release 2016-02-26 11:14:23 -05:00
Alex Yocom-Piatt
bc44bcfc20 Add getstakeinfo to rpcAskWallet list to return proper error 2016-02-25 16:52:27 -06:00
John C. Vernaleo
26fdbd149a Catch up dcrctl version too. 2016-02-25 15:20:30 -05:00
SG-O
33ff4be5a0 Corrected internal version from 0.0.1-beta to the current release version. 2016-02-25 17:42:34 +01:00
Alex Yocom-Piatt
aa21c12f0f Fix coin supply counter to reduce work and tax subsidy based on voters
The first pass for the getCoinSupply command did not accurately reduce
the work and tax subsidies based on the number of voters. So the
coinsupply was slightly high due to blocks that had less than 5 voters
not being properly reduced to match the proper total block reward. Looks
like this reduces current coin supply count by roughly 1507 DCR
2016-02-24 22:16:21 +00:00
cjepson
f001389ff1 Add JSON RPC handling for listscripts wallet command
Framework handling the new listscripts JSON RPC command for wallet
has been added. This will allow wallet users to dump the complete list
of redeem scripts from their wallet.
2016-02-24 13:42:00 -05:00
Alex Yocom-Piatt
638fff6b60 Change templatePool map to be map[[64]byte] instead of [32]byte
The key to the templatePool map is now MerkleRoot + StakeRoot
together to avoid possible false hits within the map using just the
MerkleRoot.
2016-02-23 13:42:22 -06:00
John C. Vernaleo
203be41a15 Add initial checkpoint.
Correct findcheckpoint output for Decred.

Closes #29
2016-02-23 13:16:13 -05:00
cjepson
18acc1194f Add handling of modified getrawmempool RPC call and existslivetickets
getrawmempool has been modified to allow for the selection of specific
transaction types from the mempool. A new RPC call, existslivetickets,
has been added. This call takes a blob of ticket hashes and returns
a blob of bit flags specifying whether or not the tickets exist. This
allows for much faster getstakeinfo calls in the wallet.
2016-02-23 12:29:02 -05:00
John C. Vernaleo
1652a0db40 Change ticket db desync from Error to Warn.
Since this is handled automatically and requires no user
action, it probably should not be an error.
2016-02-22 11:13:49 -05:00
cjepson
5e0163fdee Increase the default number of outbound peers 2016-02-22 11:01:20 -05:00
Dave Collins
f92e75ad10 server: Allow IPv6 addresses with zone id.
This modifies the IP parsing code to work with IPv6 zone ids.  This is
needed since the net.ParseIP function does not allow zone ids even
though net.Listen does.
2016-02-22 09:11:46 -05:00
John C. Vernaleo
0e60dff29e Change CheckpointConfirmations to 4096.
This value fits the parameters for Decred better.
2016-02-19 17:25:08 -05:00
Dave Collins
f7fd7ec50b findcheckpoint: Update to allow first checkpoint.
This updates the findcheckpoint utility to work when there are not
already any checkpoints.  This doesn't really matter for Bitcoin at the
current time, but if a new testnet is created it will not have any
checkpoints to start with and this change also means the utility can
work for alts.

While here, switch a couple of error prints to ensure they contain a
final newline.
2016-02-19 17:20:32 -05:00
cjepson
3f706d2358 Add JSON RPC handlers for getstakeinfo and related functions
The JSON framework has been modified to enable two new RPC calls,
existsliveticket and getstakeinfo. existsliveticket handling has
been added to the daemon RPC. It checks for the existence of a ticket
in the live ticket stake database given a hash.
2016-02-19 11:33:06 -05:00
John C. Vernaleo
ca9365aea0 Fix minor comment typo. 2016-02-19 08:05:42 -05:00
cjepson
9740110fb6 Plug in and enable mempool address indexing
Although the address indexer for the memory pool was a part of its
struct, it was not enabled in the daemon. The framework to enable it
by default has been completed and the mempool should now correctly
index transactions by address.
2016-02-18 11:22:18 -05:00
David Hill
2edc483aec rpcserver: cache the results of getcoinsupply 2016-02-17 17:17:09 -05:00
Alex Yocom-Piatt
4868ed4d3d Remove rpc cmd Results that only have 1 field
Instead just return field value in rpc handler
2016-02-17 16:05:28 -06:00
cjepson
2f9fc2d450 Add JSON RPC handling for per transaction VoteBits manipulation
This adds the JSON handling for the per ticket manipulation of the
VoteBits field in wallet.
2016-02-17 11:27:31 -05:00
Alex Yocom-Piatt
c77e541563 Add getcoinsupply rpc command
This RPC command should be able to hold us over until new db has been
added which will allow us to more quickly / less expensively track total
coin supply.

This is the current implementation in pseudo code:
1) Get tip block height
2) Iterate over all blocks, get block hash then get block header from
that hash.
3) If block 1, add block 1 subsidy as defined in chaincfg/params.go
4) If current block is a "reduction interval", then reduce base subsidy
accordingly
5) Calculate PoW, PoS and dev subsidy for current block
6) Add subsidies to running total (only PoW and dev if < Stake
Validation Height)
2016-02-16 20:23:15 +00:00
John C. Vernaleo
9a059dc991 Move one of the testnet seeders 2016-02-15 16:11:58 -05:00
John C. Vernaleo
bf3c383f3d Enable travis ci. 2016-02-15 15:36:19 -05:00
John C. Vernaleo
14769a741b Resolve all remaining issues caught by goclean.sh 2016-02-15 11:24:00 -05:00
Frank Braun
33ff72f031 Adjust sample-dcrctl.conf for dcrctl options.
Most stuff in the file was still for dcrd.

Closes #11
2016-02-12 16:22:34 -05:00
John C. Vernaleo
8b149a27b4 Correction to one fee min. 2016-02-12 16:20:42 -05:00
John C. Vernaleo
62d487122f Fix formatting of an error message. 2016-02-12 16:10:24 -05:00
John C. Vernaleo
1954bf24bb Work on improving the use of analysis tools in goclean.sh
Corrected or added many comments.

Update test code to follow format go vet wants.

The code doesn't pass the checks 100% yet.  That will come in a later
commit but these all seemed related so I'd rather get them in now.
2016-02-12 15:24:32 -05:00
Frank Braun
1b42b8704c Bring version in sync with dcrd. 2016-02-12 15:22:40 -05:00
cjepson
5d04f47557 Reduce the amount of fees required for a transaction and add limits
The amount of fees required before a transaction is considered free has
been reduced. This also should allow smaller outputs by adjusting the dust
limits. At the same time, the code defining where a dust limit is has been
corrected. A new minimum threshold for a transaction to be included in the
wallet has also been added.
2016-02-12 15:09:46 -05:00
Dave Collins
42ae03b663 rpcserver: Improve getwork handling.
This modifies a few things to improve the getwork RPC call handling.

First, it corrects the calculation of the getworkDataLen constant to
work with any size block header.  The current code calculated the
correct value for the current block header size, so the value of the
constant is not being changed, however the code was not accurate for an
arbitrary header size.

This is the case because the padding for the blake256 hash algorithm
requires a single 1 bit after the payload to be hashed in addition to
the 64 bits which encode the length of the message which is 65 bits.  It
also requires the final bit of the padding prior to the encoded message
length to be a 1 and to fall on bit 448.  This ensures the final block
is 64 bytes.

For a concrete example, the current code would incorrectly calculate
that a 184 block header only needs a getwork data length of 192, instead
of the 256 that is really required.

Second, because the block header size is constant and can't change while
the daemon is running, calculate the appropriate padding for the block
header size at init time rather than hard coding it directly in the get
work function.  This also means new memory doesn't need to be allocated
for the constant bytes on every invocation as it was previously doing.

Finally, preallocate the full size of the getwork buffer instead of
using append which incurs the overhead of additional memory copies.
This is how it's done in upstream btcsuite and I'm not sure why it was
changed to be less efficient in Decred.
2016-02-12 12:35:41 -05:00
Kefkius
7e1e205c70 Fix documentation for opcodeInvalid
Change 'opcodeReserved' to 'opcodeInvalid'
2016-02-12 09:11:49 -05:00
Frank Braun
1e22c04fa6 Remove btcsuite artifact and word doubling.
Adjust links for Decred.
2016-02-12 08:58:43 -05:00
Alex Yocom-Piatt
4008f81a8d Add GetWalletFeeCmd to dcrjson cmd/results 2016-02-11 16:24:04 -05:00
cjepson
08a3d7f972 Fix an incorrectly thrown error given by the address indexer
The address indexer would throw an error that would break indexing for a
block if it encountered an unparseable input or output script. Now it
skips the script and continues.
2016-02-11 13:54:09 -05:00
Kefkius
4d5ee10d66
Remove duplicate stack tests 2016-02-09 11:54:44 -05:00
John C. Vernaleo
acf973c2a6 Fix a test to match commit cb112a8 2016-02-08 17:33:40 -05:00
John C. Vernaleo
216aa759fa Re-add genesis block 2016-02-08 12:21:43 -05:00
cjepson
cb112a81e6 Fix bug causing multisignature failure on IsStandard check
An off by one bug caused by inheritance from Bitcoin caused
multisignature transactions that were fully signed to be rejected
due to the number of stack items. The off-by-one bug has been fixed.
2016-02-08 10:02:33 -05:00
John C. Vernaleo
5076a00512 Initial Decred Commit.
Includes work by cjepson, ay-p, jolan, and jcv.

Initial conceptual framework by tacotime.
2016-02-07 14:00:12 -05:00