Skip to content

Ensure device removal doesn't affect unaffiliated stake #113

@annybs

Description

@annybs

Say a stake is reassigned from device A to device B, creating a pending transaction. Device A won't know it is unassigned until the transaction is processed and enters the blockchain. In this period, it is theoretically possible for device A to be removed, creating a second pending transaction that unassigns the stake (being that the unassign_stake action doesn't require a device input).

This is a highly unlikely scenario but we should take the extra step to mitigate it by checking pending transactions before removing a device. If any pending transaction pertains to the target stake, it should be ignored (but other device events still allowed, namely removal).

After this change is made we should also explore the necessity of checking pending transactions for other actions, e.g. adding to network, or anything else that may alter the stake.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions