-
Notifications
You must be signed in to change notification settings - Fork 127
client/ui/btc: Configure wallet bday #1439
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
Conversation
If fresh wallet is selected, the current time will be used for the birthday. If earliest possible is selected, if the seed generation time is stored, that time will be used, otherwise the hardcoded date will be used. If the custom date is selected, that date will be used unless either the seed generation time is or the hardcoded date is later. |
This seems like exactly what |
I was thinking the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working well.
It's now using |
This comment was marked as resolved.
This comment was marked as resolved.
I'm gonna put this in a tiny PR so we can have it in 0.4.1 |
Conflicts with QR code merged. Will review latest commit asap though. |
4720cc9
to
a468245
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of comments.
client/core/core.go
Outdated
@@ -1896,6 +1909,17 @@ func (c *Core) WalletState(assetID uint32) *WalletState { | |||
return wallet.state() | |||
} | |||
|
|||
// AssetHasActiveOrders checks whether there are any active orders or | |||
// negotiating matches for the specified asset. | |||
func (c *Core) AssetHasActiveOrders(assetID uint32) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, but the front-end has everything it needs for this already in the User
object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That reminds me, I had something similar in frontend for the rescan PR but we ended up moving into Core for the check. 3ab44ef Can use that JS or something like it if you want to move the logic to frontend.
This is a different use case of course, but here's the previous discussion: #1374 (comment)
I ended up agreeing that it made sense to check in Core, but I also appreciate that frontend can know too, even if its check might turn out to be stale, with Core ultimately blocking it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohhhh, this method is double-purposed in apiWalletSettings
as well as loadWallet
. Yah, it could be omitted from the wallet setting response.
Silly conflict with btc.go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All working well. Just a few formatting and grammatical issues with the birthday config opt description.
IsBoolean bool `json:"isboolean"` | ||
IsDate bool `json:"isdate"` | ||
DisableWhenActive bool `json:"disablewhenactive"` | ||
IsBirthdayConfig bool `json:"isBirthdayConfig"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of a separate field, how about just handle a special DefaultValue
"now"
or "birthday"
like you did with the min and max values.
if (opt.isdate && opt.default === 'now')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The behavior I wanted on the UI was to have the default value be "now" if the current installation created the seed, but otherwise be the default value passed in the config.
9498976
to
97e966a
Compare
can merge, but I made conflicts |
The wallet birthday for the bitcoin SPV wallet was previously always set to a hardcoded value. This diff stores the time when the app seed was generated in the db to give an earliest possible time so scan from, and also adds options on the UI to specify the desired wallet birthday. Also, the wallet birthday can now be updated when reconfiguring the wallet.
The wallet birthday for the bitcoin SPV wallet was previously
always set to a hardcoded value. This diff stores the time when
the app seed was generated in the db to give an earliest possible
time so scan from, and also adds options on the UI to specify the
desired wallet birthday. Also, the wallet birthday can now be updated
when reconfiguring the wallet
Closes #1270.