385 Commits

Author SHA1 Message Date
Jamie Holdstock
a1091015ff Split ticket info into ticket, fee and voting info 2021-06-01 07:17:54 +08:00
Jamie Holdstock
2cdc5a74b5 Split admin page into tabs.
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.
2021-06-01 07:17:54 +08:00
Jamie Holdstock
7edbd02d4e Use proper background color. 2021-06-01 07:17:54 +08:00
Jamie Holdstock
32c5c7a524 Indent JSON on admin screen. 2021-06-01 07:17:54 +08:00
Jamie Holdstock
851d3137e5 Improve voting wallet status aesthetics. 2021-06-01 07:17:54 +08:00
Jamie Holdstock
e05ced391a Various minor cleanups.
- Updating and adding some copyrights which were missed recently.
- Slight improvements to some commenting and naming.
2021-06-01 07:17:11 +08:00
Jamie Holdstock
20cb546e74
Store each ticket in its own DB bucket.
**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.
2021-05-24 17:45:47 +08:00
Jamie Holdstock
136e389f95 Update to golangci-lint 1.40.1.
Linter `golint` has been deprecated and replaced with `revive`.
2021-05-23 11:37:54 +08:00
Jamie Holdstock
2d0db6f6b3 Remove confirmed fee tx hex.
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.
2021-05-20 13:33:41 +08:00
Jamie Holdstock
1988322cac Add timezone to GUI timestamps 2021-05-20 13:04:33 +08:00
Jamie Holdstock
8b5cd2a014 Properly close db after running tests 2021-05-18 23:25:42 +01:00
Jamie Holdstock
a8c0ae95ac
Use a custom Recovery middleware. (#255) 2021-05-18 07:27:12 +01:00
Jamie Holdstock
b050fc3100
Set and display ticket purchase height (#250)
* 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.
2021-05-14 21:19:01 -05:00
Jamie Holdstock
08fafdaf31
Remove relayFee todo. (#256)
Accepting this as a hard-coded value. It will not be retrieved from RPC or config.
2021-05-14 21:09:24 -05:00
Jamie Holdstock
ef472ffe5d
Include best block height in /vspinfo response (#254) 2021-05-14 21:09:03 -05:00
Jamie Holdstock
0936e090a9 Remove non-existent simnet block explorer. 2021-05-13 12:16:08 +01:00
jholdstock
3a97c9214b Show formatted date for fee expiry 2021-05-13 12:16:08 +01:00
jholdstock
b5a65a9e78 Add block explorer links to tx hashes and fee addr 2021-05-13 12:16:08 +01:00
jholdstock
7cb0ded1fe Use a proper type for admin page search results. 2021-05-13 12:16:08 +01:00
Jamie Holdstock
4810802fa9 Make log rotator params configurable.
Maintaining the dafault max log file size of 10MB, but increasing the default number of retained files from 3 to 20.
2021-05-13 02:20:18 +01:00
Jamie Holdstock
5f8ad656f7
Add framework for database upgrades. (#242)
Plus a few other miscellaneous pieces which will be usedful soon:

- Remove `Get` from func names `GetCookieSecret` and `GetFeeXPub`.
- Add helpers to encode/decode integers/bytes.
2021-05-05 08:54:51 -05:00
Jamie Holdstock
391e436a71 Add missing error handling to /getfeeaddress.
Failing to generate a fee address for a ticket is a critical error, and should be handled as such.
2021-04-30 21:37:31 +01:00
Jamie Holdstock
b0521251e4 Make test Tickets more realistic.
Use randomly generated values of the correct length in test Tickets, rather than using hard-coded and unrealistic values. This code was produced to aid with benchmarking DB performance.

Also fixing some minor typos/errors noticed while working in this file.
2021-04-30 21:37:12 +01:00
Jamie Holdstock
b92c31861f Remove check for duplicate fee address index.
This check was added to InsertNewTicket pre-emptivly as a sanity check. It is not strictly required because the fee address itself is also checked, and there is no scenario where we would expect a fee address and its index not to match.

Removing this check eases the route forward to improving database performance.
2021-04-30 21:37:12 +01:00
Jamie Holdstock
4858af2682
Upgrade deps (#239)
* Update to latest deps.

Includes using the dcrd stdaddr package instead of dcrutil.

* Use stdaddr.Hash160
2021-04-26 09:12:23 -05:00
Jamie Holdstock
79cdeaaf8b
Add parser for blockconnected notification (#238) 2021-04-25 08:22:13 -05:00
David Hill
2581f84b59
build: update dcrwallet mod (#237) 2021-03-09 15:29:26 +00:00
David Hill
4b43711b03
build: Test against Go 1.16 (#236) 2021-03-01 12:32:22 +00:00
Jamie Holdstock
681341ca0e
Bump version to 1.1.0-pre (#233) 2021-03-01 12:06:09 +00:00
Jamie Holdstock
91701b1a17
Update dcrd/blockchain dep (#230) 2021-01-22 19:20:53 +00:00
David Hill
7d83d6acba
build: bump dcrwallet to release (#229) 2021-01-22 14:43:14 +00:00
David Hill
707ded57df
webapi: put error checking where it belongs (#228) 2021-01-22 10:25:51 +00:00
Jamie Holdstock
c71fbb024b
Make ticket parent mandatory (#218)
* Make ticket parent mandatory

* Reduce scope of request types which arent reused.
2021-01-04 14:55:21 +00:00
Jamie Holdstock
861eb1c377
Add version command. (#222)
Add a version config item which will cause the application to print version information and then exit.
2021-01-04 14:44:44 +00:00
Jamie Holdstock
49982533ab
Don't log err which is always nil. (#221) 2020-12-30 12:36:27 +00:00
Jamie Holdstock
ac8e20f3c1
Use actual request in response, dont reserialize. (#220)
Reserializing the client request can result in different bytes because
the order of iteration over a map is not guaranteed to be the same every
time.
2020-12-30 12:36:06 +00:00
Jamie Holdstock
268d293749
Release 1.0.0 release note (#217) 2020-12-29 18:59:47 +00:00
Jamie Holdstock
e5d449f149
Clear TODOs from accountability doc (#216)
* Clear TODOs from accountability doc

* Add note about master/release

* Add missing space
2020-12-29 18:59:21 +00:00
Jamie Holdstock
fe286a5d1a
Reject reused or old timestamps. (#215)
* Reject reused or old timestamps.

* Refine error mesage
2020-12-27 15:22:17 +00:00
Jamie Holdstock
057b89e2f2
Only marshal DB record when needed (#214)
* Only marshal DB record when needed

* Lock mutex before deferring Unlock.
2020-12-27 15:20:46 +00:00
Jamie Holdstock
6474f0ea4c
Additional test coverage for DB code. (#213)
* Test DB HTTP backup

* Test DB initialization

* Test CountTickets
2020-12-26 20:42:50 +00:00
Julian Y
2bee3203bd
Fix minor spelling (#211) 2020-12-17 10:40:19 +00:00
David Hill
2a096d81f9
fix errorlint warnings (#193) 2020-11-25 15:14:18 +00:00
David Hill
bd6b2e42f4
build: upgrade deps (#210) 2020-11-25 14:52:21 +00:00
Jamie Holdstock
33703d972a
Properly call String function. (#209) 2020-11-25 14:37:25 +00:00
Jamie Holdstock
4f8b3c79eb
Add debug logging to TicketInfo RPC. (#208) 2020-11-21 22:12:29 +00:00
David Hill
1c6f962e2b
api: add optional parent transaction to feeaddress (#205) 2020-11-20 13:10:13 +00:00
jholdstock
0f657eb4fe Register tickets with invalid vote choices.
/payfee will no longer reject tickets with invalid vote choices. The tickets will be registered with the VSP and added to voting wallets, but their voting choices will be empty. A warning will be added to server logs.
2020-11-16 14:00:17 +00:00
David Hill
04b07346c8 build: bump deps 2020-11-09 17:00:25 +00:00
jholdstock
1013354292 Update to latest dcrd deps 2020-10-28 12:37:03 +00:00