If an alternate address exists for this ticket, check it first and fall
back to the commitment address if validation fails. Alternate address
failure is allowed so that other endpoints do not need to add a field to
all requests specifying whether this is the alternate address's
signature or the commitment address's signature.
To allow signing with addresses other than the commitment address, add
an alternate signature address. In order to continue to prove that the
address was chosen by the user, add an alternate signature history. Only
allow one record per ticket to be saved to cap needed db space.
This commit marks the point at which vspd will stop working against dcrd 1.6 and start to target master.
The dcrwallet RPC version has not changed, so vspd continues to work with dcrwallet 1.6 or master.
* Use features from Go 1.16 tooling.
- GO111MODULE environment variable now defaults to "on"
- "go build" and "go test" now exit with an error rather than silently modifying go.mod or go.sum files
- Update README.md
* Don't use deprecated ioutil package.
Bring in some updates from the signal handling code in other projects:
- Rename `signals` to more descriptive `interruptSignals`.
- Add SIGHUP to unix shutdown signals. Rename `signalsigterm.go` to `signal_unix.go` accordingly.
- Include extra detail in "Already shutting down..." messages log lines.
- Pass a shutdown func into `webapi.go` rather than a channel. It's more obvious how to invoke a func, whereas a channel can be used in multiple ways.
* Be more specific about consensus vote choices.
Rather than referring to just "Vote choices", refer specifically to "consensus vote choices".
This will be useful when treasury and tspend vote choices are added, and the distinction becomes more important.
* dnldd suggestion.
* Remove static cfg values from GUI cache.
Theres no need for these values to be copied into the cache when templates could simply access the config struct directly.
This also changes the cache accessor so it returns a copy of the cache rather than a pointer, which removes a potential race.
* Rename and move cache.
Cache code was previous in `homepage.go`, but its used in multiple places and not just on the homepage. Its enough code to go into its own dedicated `cache.go`.
Previously two different strings were used as cache busters in favicon files. Only one is required. Using multiple increases the chance of making mistakes when updating the cachebuster in future.
* Add network proportion to homepage and /vspinfo.
Proportion is calculated using the number of tickets currently registered with the VSP, divided by the total size of the network ticket pool as reported by `getblockheader`.
The value will only ever be an estimate because:
- it's possible for a single ticket to be added to multiple VSPs.
- vspd does not distinguish between immature and live tickets, whereas `getblockheader` only reports live tickets.
- `getblockheader` is reporting the size of the ticket pool as of the previous block, not the current block.
* xaur suggestions
* Show missed ticket %, not just the raw number.
* Decode fee address with stdaddr.
Compare script and script versions rather than just comparing address strings.
Also move the fee amount check higher, so it is with the rest of the fee validating code.
* Compare voting addr scripts rather than addrs.
Rather than comparing the address strings, ensure both voting script and script version match.
Previously the voting wallet status and the ticket search were stacked on top of eachother, making the page very long and awkward to navigate. This introduces tabbed navigation which allows just one to be displayed at a time.
**NOTE: This contains a backwards incompatible database migration, so if you plan to test it, please make a copy of your database first.**
Moves tickets from a single database bucket containing JSON encoded strings, to a bucket for each ticket.
This change is to preemptively deal with scaling issues seen with databases containing tens of thousands of tickets.
This PR introduces a database migration which deletes any raw fee transactions which remain in the database after already having been confirmed on-chain. There is no need to keep these, and they take up a lot of space.
There is also a change in the background handler to ensure that in future, tx hex is always removed from the database when the tx is confirmed.
* Ensure purchase height set for confirmed tickets.
* Show purchase height in admin screen.
Only show purchase height when the ticket is confirmed, because if a ticket is not confirmed, its purchase height is not yet known.