466 Commits

Author SHA1 Message Date
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
Jamie Holdstock
b40681d38e
HTTP 428 when fee tx references unknown outputs. (#195)
JSON body will be `{"code": 16, "message":"fee transaction could not be broadcast due to unknown outputs"}`
2020-10-27 11:15:39 +00:00
jholdstock
56a5aa5b1d background: Exit early if no votable tickets 2020-10-09 12:41:11 +00:00
David Hill
a67de8a024
rpc: optimize TicketInfo (#189) 2020-10-05 10:30:42 +01:00
jholdstock
288aa09c6d Stop blockConnected handler if no wallet connected 2020-10-01 12:45:15 +00:00
jholdstock
c82b08b760 Use shutdownCtx for dcrdWithNotifs 2020-09-25 15:59:12 +00:00
jholdstock
f06d4cd8ba Use background context for background processes 2020-09-25 15:59:12 +00:00
jholdstock
5c41761f1e Dont handle notifs during shutdown 2020-09-25 15:59:12 +00:00
David Hill
c83a2a0085
rpc: verify dcrwallet's have --manualtickets set. (#187) 2020-09-25 09:55:53 +01:00
jholdstock
fedd2cd784 Serialize record before creating bucket 2020-09-17 16:05:07 +00:00
jholdstock
825a717ca7 Store records of vote choice changes 2020-09-17 16:05:07 +00:00
jholdstock
d0c3abf258 Make funcNames constant.
Aside from just being a sensible thing to do, this also prevents a local stack allocation.
2020-09-17 14:21:17 +00:00
jholdstock
f2ae9a81ea Dont underline logo on hover 2020-08-31 17:18:30 +00:00
jholdstock
c7f8cea4dc webapi: base64 encode server signature 2020-08-31 17:14:33 +00:00
jholdstock
5a8bc49c22 Unique error for fee broadcast failure 2020-08-21 12:46:58 +00:00
jholdstock
8c428c769d Return descriptive error if ticket cannot be broadcast 2020-08-21 12:46:58 +00:00
jholdstock
4a207b15f8 Add missing copyright notices 2020-08-19 20:22:12 +00:00
jholdstock
dab1666310 Only load .html files in template dir 2020-08-19 20:20:13 +00:00
jholdstock
e2483b6cea Fix backup file mode 2020-08-17 19:14:57 +00:00
jholdstock
6c12ddeb31 Write a backup after closing the db, not before 2020-08-17 19:14:57 +00:00