Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ticketbuyer: Add RPC calls to get/set config #1

Open
wants to merge 25 commits into
base: loader-ticketbuyer
Choose a base branch
from

Conversation

tuxcanfly
Copy link
Owner

As mentioned in btcsuite#509 added gRPC methods which allow fine tuning the configuration options for ticketbuyer.

Depends on btcsuite#532

@tuxcanfly tuxcanfly force-pushed the loader-ticketbuyer branch 4 times, most recently from a49b561 to e86e29a Compare February 28, 2017 16:23
This bucket has been unused since headers syncing was introduced.
Remove it from the database with an upgrade.

While here, change the waddrmgr db version check to check for an exact
version match.  We do not want old code to be used on upgraded
databases.
@tuxcanfly tuxcanfly force-pushed the ticketbuyer-rpcs branch 3 times, most recently from 4315d00 to 3811740 Compare March 1, 2017 16:14
jrick and others added 4 commits March 6, 2017 17:05
The new database format contains only a single version, and allows for
each separate component to be upgraded together when necessary
(e.g. upgrades that must change stuff in the address manager and
transaction store buckets can now be done atomically).

A migration must be performed to convert the old DB into the newer
format.  This migration consists of performing any legacy upgrades
that have not yet been done, removing the old separate versions, and
writing a single version to the new unified database metadata bucket.

Because each of the three manager packages previously defined their
own error types, and all did essentially the exact same thing, these
were replaced with a single apperrors package containing the same
functionality.  The long term goal is to use this package for more
than just the database layer, but also the wallet package itself.
The github.com/btcsuite/golangcrypto fork is still being pulled in due
to dcrd deps, which will also have to be switched over.
This also removes the last traces of github.com/btcsuite/golangcrypto
which was previously being pulled in as a dep of a dep.
Ticket purchase manager now keeps a copy of the passphrase so that the
wallet can be unlocked to make purchases.
dajohi and others added 5 commits March 8, 2017 15:14
- Include immature coinbase credits
- SSTXs are not coinbase rewards
- Also include unconfirmed in the total.
- Correctly add normal transactions to Spendable when minConf==0
- Handle unmined stake transactions properly.
This new method takes a read-only database transaction, rather than
the bucket.  This differs from the rest of the API which currently
takes namespace buckets themselves, but this is the direction that I
want to take the API.

To remove some generated garbage created by creating the bucket key
bytes, do the conversion once and save the keys as package variables.
Use these consistently across the entire package.
This one does not derive branch keys, so it can be used slightly more
efficiently when multiple branch xpubs must be derived.

While here, fix a data race caused by reading and writing cached
manager data without the write lock held.
jcvernaleo and others added 9 commits March 15, 2017 11:32
Increase linter time limit

Remove go 1.8 since it has issues and we don't currently use or
recommend it anyway.
This change moves the wait for the session RPC response (used as a
pong) to a new goroutine that does not run directly in the queue
handler.  By moving this out to a new goroutine, the handler can
continue enqueuing and dequeueing notifications while waiting for the
session response.  Previously, if a notifiation was sent after the
session RPC was called and before the response was received, the
rpcclient main loop would block due to being unable to enqueue the
notification.
This resolves double spend errors that are caused by creating and
publishing multiple transactions while in a single database
transaction.  If any of the tickets can not be purchased, the
transactions that were published remain tracked by the database.

The PurchaseTickets method has also been changed to always return the
hashes of all successfully published tickets, even if less than the
requested number could be bought.  This allows ticketbuyer to update
its statistics with the number of bought tickets if only some were
successfully sent.

While here, add a comment about why a hardcoded minconf=0 in the auto
ticket buyer code is needed.
This updates dcrd and dcrutil deps.
@tuxcanfly tuxcanfly force-pushed the ticketbuyer-rpcs branch 2 times, most recently from b54f076 to 8ee128c Compare March 24, 2017 17:28
* Added docs
* Bumped version
* Rename max_fee -> max_fee_per_kb for consistency
* Rename ticket address -> voting address
* SetPoolAddress - remove unnecessary check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants