-
Notifications
You must be signed in to change notification settings - Fork 14
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
Check if we can spend or stake remote staking outputs #517
Check if we can spend or stake remote staking outputs #517
Conversation
At first, I introduced enum isminetype
{
ISMINE_NO = 0,
ISMINE_WATCH_ONLY = 1,
ISMINE_STAKEABLE = 2,
ISMINE_SPENDABLE = 4,
ISMINE_FULL = ISMINE_STAKEABLE | ISMINE_SPENDABLE,
ISMINE_HW_DEVICE = 12, // 0b1100, implies ISMINE_SPENDABLE
ISMINE_HW_FULL = ISMINE_STAKEABLE | ISMINE_HW_DEVICE, // spendable with hardware wallet and stakeable
ISMINE_ALL = ISMINE_WATCH_ONLY | ISMINE_FULL
}; I thought that it looked horrible and decided to rewrite it and to introduce a separate function |
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.
utACK ea295d2.
Note on your worries about the enum: ISMINE_HW_FULL = ISMINE_STAKEABLE | ISMINE_HW_DEVICE
is not a real-life usecase, because it would require the user to unlock his hardware wallet every time he wants to propose a block, and we want this to be a periodic, automatic process. So the enum would only need one additional member, ISMINE_STAKEABLE
.
The solution with IsStakeableByMe
is okay too, though.
@cmihai |
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.
utACK ea295d2
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Wallet CWallet::AddToWalletIfInvolvingMe calls IsMine to check if a transaction should be added to the wallet. This commit adds IsStakeableByMe to IsMine so remote staking outputs which are stakeable but not spendable will also be added to the wallet. Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
ea295d2
to
22b1e2a
Compare
utACK 22b1e2a Thanks for addressing these! |
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.
LGTM, utACK 22b1e2a
This PR implements
IsMine
for remote staking and introducesIsStakeableByMe
which checks if an output with givenscriptPubKey
can be used as a stake.