Commit Graph

68 Commits

Author SHA1 Message Date
David Hill
5fc31ca578 multi: fix misspell linter warnings 2018-02-18 12:26:52 -06:00
Donald Adu-Poku
66bf35020a rpc: Add localaddr and relaytxes to getpeerinfo 2017-11-29 22:21:17 +00:00
Donald Adu-Poku
06468ffcfa rpcserver: avoid nested decodescript p2sh addrs 2017-11-28 17:46:41 +00:00
Donald Adu-Poku
f11fac8134 multi: update stakebase tx vin[0] structure.
modifications to the stakebase tx vin[0] required adding a stakebase
field to Vin and VinPrevOut structs as well as updating the
rpc documentation for the affected calls.
2017-09-23 03:24:55 -05:00
Donald Adu-Poku
19778ce58d rpcserverhelp: update TicketFeeInfo help. 2017-08-06 23:16:29 +00:00
Dave Collins
c50d43e3cb
rpcserver: Improve help text for getmininginfo.
This improves the help text for stakedifficulty field of the
getmininginfo RPC to clarify it is the value for the next block.

Also, update the JSON-RPC docs entry to include the field which should
have been done previously.
2017-07-18 21:13:39 -05:00
David Hill
2a2ab090ec dcrjson: getblocksubsidy support. (#679) 2017-05-23 13:09:49 -04:00
Josh Rickmar
39734da2e4 rpcserver: Add existsmissedtickets RPC.
This RPC works identically to the existsexpiredtickets RPC but checks
for missed rather than expired tickets.
2017-05-17 10:24:56 -04:00
Dave Collins
05d8456d3e
multi: Rename vote choice IsIgnore to IsAbstain.
This renames the chaincfg parameter for the vote choice which represents
an abstaining vote to be named IsAbstain instead of IsIgnore since that
more accurately describes its intent and behavior.

It also updates the RPC server choice result field for isignore to be
named isabstain to match and bumps the major version accordingly.

Finally, it renames other internal variables which make use of the
choice to include the word abstain as well for clarity and renames a
couple of other internal variables.
2017-04-24 16:17:27 -05:00
Marco Peereboom
54d1da3151 Convert version array to version:bits tuple. (#586)
Propagate version and bits on the getstakeversions call.  Now we can
interrogate all raw vote version/bits data in addition to cooked values.

Diff is mostly mechanical exporting the Version:Bits tuple.
2017-02-21 12:39:43 -05:00
Marco Peereboom
5205214013 davec nits 2017-02-16 11:37:43 -06:00
Marco Peereboom
4b2c7cbf0d Add getstakeversioninfo command. (#568)
The getstakeversioninfo command returns vote and stake versions tally
for N intervals.  It does always start with the current top of the chain
and counts backwards.
2017-02-16 11:54:19 -05:00
Marco Peereboom
b3763d4594 Create a tuple for vote version+bits.
With this change we can keep the version and the bits in blockNode.
This is used to fix an oversight where we weren't strictly enforcing
the vote version.  This also adds tests that validate quorum-1, quorum,
75%-1 and 75% rules during tallying.

Also adjust getvoteinfo totals to only return the specified vote version
totals.
2017-02-15 13:12:23 -06:00
Marco Peereboom
6967358649 blockchain: Implement configurable voting on top of PoS. (#542)
Port BIP0009 over from btcd.  The following is an overview of the
changes:
- Add new configuration options to the chaincfg package which allows the
  rule deployments to be defined per chain
- Implement code to calculate the threshold state as required by voting
  - Use threshold state caches that are stored to the database in order
    to accelerate startup time
  - Remove caches that are invalid due to definition changes in the
    params including additions, deletions, and changes to existing
    entries
  - Verify that PoW and PoS majorities have been reached.
- Add tests for new error type
- Add tests for threshold state
- Deployments are per stake version.
- Add human readable vote/choice infrastructure.
- Add RPC command to interrogate vote status (getvoteinfo).
2017-02-13 13:32:40 -05:00
Marco Peereboom
278a491543 Add block version to getstakeversions (#556) 2017-02-08 15:42:30 -05:00
Marco Peereboom
3e4ed1b49d Implement stake voter version interrogation command. (#522)
Fixes #521
2016-12-21 22:14:13 -06:00
Josh Rickmar
ed7c45a3e1 Use same notification for mined transactions and blocks. (#434)
Change the block connected and disconnected notifications to include
the entire block header.

Do not notify the previous block's regular tree transactions if the
newly attached block voted to approve them.  Instead, notify the
regular transactions from the newly attached block.  It is up to the
client to check the vote bits in the header to decide how to handle
the previous block's regular transactions.

Every websocket client now has an associated transaction filter that
is used to determine whether or not a processed transaction is (or
might be) relevant to the client.  A new RPC, loadtxfilter, has been
added to load, reload, or add to this filter.

Redo the entire rescan RPC to scan over previously-processed blocks
using the same transaction filter (rather than specifying which
addresses and outpoints to watch for in the rescan request).

Fixes #433.
2016-11-08 16:18:32 -05:00
Marco Peereboom
2d242b224e Add StakeVersion bits to various subsystems. (#441)
Bump block version and add stake version to wire.  Currently
StakeVersions are unused and once the enforcement logic goes in the
versions will bump again.

This fixes #435
2016-11-07 13:06:17 -06:00
Alex Yocom-Piatt
b086c13d6b Add existsexpiredtickets to rpcserver (#418) 2016-10-24 10:31:48 -05:00
David Hill
07e1e308f1 rpc: Add localaddr and relaytxes to getpeerinfo 2016-10-19 19:58:50 -04:00
David Hill
403aaf5cf3 rpcserver: avoid nested decodescript p2sh addrs 2016-10-19 13:59:50 -05:00
Josh Rickmar
70c5a4957a Add getheaders JSON-RPC extension command. (#426)
This RPC is essentially a reimplementation of the wire protocol
getheaders and headers messages and is planned on being used by the
wallet to fetch block headers during startup sync.
2016-10-18 16:57:38 -04:00
Josh Rickmar
8e4b78998e Version the JSON-RPC API with semantic versioning. (#387)
Start at version 1.0.0.
2016-10-05 18:46:06 -04:00
Javed Khan
7401db6098 rpcserver: searchrawtx - update coinbase output (#299) 2016-08-10 11:53:00 -05:00
Dave Collins
d3ef588608 multi: Update with result of gofmt -s.
Contains the following upstream commits:
- d4852101d4
  - This commit has already been independently applied so it is mostly a
    NOOP
- f389742b39

In addition, gofmt -s has been run again to simplify the new additions
to Decred and and all simplifications are included in the merge commit.
2016-05-30 12:40:44 -05:00
Dave Collins
3799575c9c rpcserver: Add filteraddrs param to srt API.
Contains the following upstream commits:
- 365b1bd156
  - Previously cherry-picked so it is a NOOP
- b691a222d5
  - Reverted because Decred uses a different signature algorithm
- c7eaee6020

In addition to the normal required changes for syncing, the following
changes have been made in order to facilitate integration into Decred:

- Rework the code which extracts stake submission outputs a bit to be a
  little more efficient and to better fit with the code being merged
2016-05-25 11:47:19 -05:00
Dave Collins
19873768b6 dcrjson: Add optional locktime to createrawtransaction
Upstream commit 4b7206b54f
2016-05-20 22:08:14 -05:00
Dave Collins
718f0f4942 Add reverse order option to searchrawtransactions rpc
Upstream commit 0190c349aa
2016-05-17 17:26:53 -05:00
cjepson
ac0d8fb13a Fix VinPrevOut fields for Decred
The VinPrevOut fields in Decred did not correspond to the
contents of Decred TxIns. This was modified so that these
are included.

Fixes #173.
2016-05-17 17:41:03 -04:00
cjepson
bee3c25021 Sync upstream through Aug 23, 2015
Requires dcrrpcclient#20.
2016-05-16 15:49:57 -04:00
C Jepson
d293c9bd30 Adjust getblockheader result for Decred (#170)
Fixes #167.
2016-05-16 11:57:15 -05:00
David Hill
c53142d5d1 Implement getblockheader RPC. 2016-05-12 14:43:04 -05:00
David Hill
83f42be247 Support getmempoolinfo. 2016-05-11 12:27:37 -05: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
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
8207e4d228 Add GetStakeDifficultyResult so we can have current and next returned 2016-04-28 11:43:57 -05: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
jolan
fd402439b2 fix typo 2016-04-20 09:54:15 -05: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
Alex Yocom-Piatt
24591713b4 Clean up and fix fallthrough on invalid tx types
Fixes #110
2016-04-12 15:08:25 +00: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
9f90be7f8f Fix minor goclean issues.
Correct a comment.

Add help text for getticketpoolvalue.
2016-03-18 11:44:11 -04: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
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
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
John C. Vernaleo
4c24488b8a Fix some missing rpc help.
Caught by go test.
2016-02-26 11:26:47 -05:00
Dave Collins
f389742b39 multi: Update with result of gofmt -s.
This commit updates the code to make use of the most recent simplified
output from gofmt.
2016-02-25 13:02:54 -06: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