40 Commits

Author SHA1 Message Date
jholdstock
1d2340d61c Update Decred dependencies for 2.1.0 2025-11-26 11:39:57 +00:00
jholdstock
0d7b33d9bd multi: Use go 1.22 language features. 2025-02-28 09:04:56 +00:00
jholdstock
906ffc9e88 multi: Consider DCP0012 in VSP fee calculations.
Upgrade the dcrwallet dependency to pick up the new version of
txrules.StakePoolTicketFee which considers the status of DCP0012 in its
fee calculation.
2024-06-30 09:22:21 +01:00
jholdstock
1e66b6ff59 Downgrade dcrwallet dep to v3.
This downgrade changes StakePoolTicketFee back to the version which does
not consider DCP-0012 activation.

This resolves an issue where Decrediton sometimes fails to pay VSP fees,
caused by Decrediton and vspd independently calculating the fee amount
using different versions of the algorithm.

Releasing the new algorithm will need to be more carefully coordinated,
potentially requiring both client and server sides to be updated in
sync.
2023-11-08 09:01:36 +00:00
jholdstock
74729c6cc9 multi: Consider DCP0012 in VSP fee calculations.
Upgrade the dcrwallet dependency to pick up the new version of
txrules.StakePoolTicketFee which considers the status of DCP0012 in its
fee calculation.
2023-09-16 08:36:41 +01:00
jholdstock
e80ebfea13 rpc: Do not store contexts in structs.
Documentation for the context package suggests that Contexts should
never be stored in structs.
2023-08-24 07:52:40 +01:00
jholdstock
c039dc86cb multi: Use const instead of var when possible. 2023-08-22 15:58:48 +01:00
jholdstock
64e044f4ed rpc: Use latest dcrd & dcrwallet 2023-06-13 08:48:46 +01:00
Jamie Holdstock
08ea48f7a3
Update decred dependencies. (#378)
* webapi: Use types 2.0.0

* v3tool: Use types 2.0.0

* Update decred dependencies.
2023-04-12 08:16:29 -05:00
jholdstock
65fab01225 Remove remaining global loggers.
This removes all of the global loggers from the project and replaces them with loggers which are instantiated in vspd.go and passed down as params.

To support this, the background package was removed. It only contained one file so it was a bit pointless anyway. It only existed so background tasks could have their own named logger.
2022-06-29 08:31:44 +01:00
jholdstock
7f72caafe7 Remove global vars from background.go
While removing the globals from background.go it also made sense to clean up the use of dcrd RPC clients. Previously two seperate clients were maintained, one for making RPC calls and one for receiving notifications. These clients have been unified.
2022-06-13 14:50:27 +01:00
jholdstock
4beb036663 rpc: Use context.TODO instead of .Background 2022-05-19 07:59:44 +01:00
jholdstock
75026f5e91 Clean up use of shutdown context.
- Rename all instances to "shutdownCtx" to be really explicit. This context is special in that it can be closed at any time without warning, so it should be obvious to the reader.
- Don't use shutdownCtx in RPC clients. Clients should not stop working immediately when shutdown is signalled, they need to keep working while the process is shutting down.
2022-05-19 07:59:44 +01:00
Jamie Holdstock
78bb28056c
Remove global cache variable. (#341)
* Remove global cache variable.

Rather than maintaining cached data in a global variable, instantiate a cache struct and keep it in the `Server` struct.

* Store net params in RPC clients.

This means net params only need to be supplied once at startup, and also removes a global instance of net params in `background.go`.
2022-03-30 11:00:42 -05:00
Jamie Holdstock
da1cb8f916
Enable treasury vote choices. (#319)
This allows both tspend and treasury policies to be set by clients on a per-ticket basis. Preferences can be set when initially registering a ticket with `/payfee`, and can be later updated using `/setvotechoices`.

Any requests which alter treasury/tspend policy will be stored in the database using the existing accountability system.

**Note:** This does not include consistency checking, it will need to be added later when dcrwallet has an RPC to retrieve policies in batches.
2022-02-04 14:14:49 -05:00
David Hill
0fd96388ce
build: bump dcr deps (#310) 2021-12-29 11:23:45 +00: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
David Hill
2a096d81f9
fix errorlint warnings (#193) 2020-11-25 15:14:18 +00:00
Jamie Holdstock
4f8b3c79eb
Add debug logging to TicketInfo RPC. (#208) 2020-11-21 22:12:29 +00:00
David Hill
a67de8a024
rpc: optimize TicketInfo (#189) 2020-10-05 10:30:42 +01:00
David Hill
c83a2a0085
rpc: verify dcrwallet's have --manualtickets set. (#187) 2020-09-25 09:55:53 +01:00
jholdstock
4a207b15f8 Add missing copyright notices 2020-08-19 20:22:12 +00:00
jholdstock
ba77d39f35 Comment exported methods 2020-08-07 17:03:03 +00:00
jholdstock
c308b8a9a6 Close RPC connection if server doesnt meet reqs 2020-08-03 13:26:47 +00:00
jholdstock
4139f25670 semver matching for dcrd/dcrwallet RPC versions 2020-08-03 13:26:47 +00:00
jholdstock
6cc246ceea Configure RPC auth per wallet host. 2020-07-30 18:26:01 +00:00
jholdstock
9d503e67ae Wallet consistency checks & setting ticket outcome 2020-07-28 20:09:23 +00:00
jholdstock
1c351d02ec Add voting wallet status to admin page 2020-07-09 21:01:20 +00:00
jholdstock
da410b5060 Update log format 2020-07-09 21:01:20 +00:00
jholdstock
c5485a28ec Return string for failed rpc connections 2020-07-09 21:01:20 +00:00
jholdstock
7f969c6db5 Dont fail wallet connection if wallet is locked 2020-07-09 21:01:20 +00:00
jholdstock
aed1e5f5d4 Extract walletinfo for re-use 2020-07-09 21:01:20 +00:00
jholdstock
b029d88fdb Check dcrwallet network before calling walletinfo RPC 2020-07-09 21:01:20 +00:00
jholdstock
70ba1adc93 Combine ImportPrivKey and AddTransaction 2020-07-09 21:01:20 +00:00
jholdstock
72c16ad2c7 Close RPC connections after the web server is stopped.
Previously all of the shutdown tasks were running concurrently, which meant the RPC connections be closed before the webserver is finished using them.
2020-06-12 13:23:55 +00:00
jholdstock
a6d9b79619 Tolerate dcrwallet connection failures.
If at least 1 wallet connection succeeds, vspd should proceed to use the connected wallet(s). Only error out if all wallet connections fail.
2020-06-04 15:56:43 +00:00
jholdstock
7da79c7561 Simplify dcrd and dcrwallet client creation. 2020-06-03 15:46:24 +00:00
jholdstock
225dcaf29e multi wallet support (#32)
* multiwallet

* print host

Co-authored-by: Jamie Holdstock <jholdstock@decred.org>
2020-05-28 12:52:06 +01:00
Jamie Holdstock
e1a18804ac
Check dcrwallet and dcrd config (#70)
* Verify dcrd network and txindex

* Verify dcrwallet network
2020-05-27 14:45:06 +01:00
Jamie Holdstock
86c4195931
Replace local fee wallet with dcrd. (#61) 2020-05-26 17:30:51 +01:00