Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

#### General

#### CLI

- \#3852 Add warning when orchestrator attempts to unbond full stake, requiring confirmation to prevent accidental deactivation (@moudi-network)

#### Broadcaster

#### Orchestrator
Expand Down
22 changes: 22 additions & 0 deletions cmd/livepeer_cli/wizard_bond.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,28 @@ func (w *wizard) unbond() {
}
}

// Warn if unbonding full amount while being an orchestrator (delegated to self)
if amount.Cmp(dInfo.BondedAmount) == 0 && dInfo.DelegateAddress == dInfo.Address {
fmt.Printf("\nWARNING: You are about to unbond your entire stake.\n")
fmt.Printf("Since you are an orchestrator (delegated to yourself), this will DEACTIVATE your orchestrator.\n")
fmt.Printf("Your orchestrator will no longer be eligible to receive work or rewards until you rebond and reactivate.\n")
fmt.Printf("Are you sure you want to proceed? (y/n) - ")

confirm := ""
for {
confirm = w.readString()
if confirm == "y" || confirm == "n" {
break
}
fmt.Printf("Enter (y)es or (n)o \n")
}

if confirm == "n" {
fmt.Printf("Unbond cancelled.\n")
return
}
}

val := url.Values{
"amount": {fmt.Sprintf("%v", amount.String())},
}
Expand Down