Compare commits
1 Commits
2ed0501176
...
c7cd30b2e0
Author | SHA1 | Date | |
---|---|---|---|
c7cd30b2e0 |
@ -751,13 +751,12 @@ impl BrainData {
|
||||
if req.escrow < 5000 {
|
||||
return Err(Error::MinimalEscrow);
|
||||
}
|
||||
let escrow = req.escrow * 1_000_000_000;
|
||||
if let Some(mut account) = self.accounts.get_mut(&req.pubkey) {
|
||||
if (account.balance + operator.escrow) < escrow {
|
||||
if (account.balance + operator.escrow) < req.escrow {
|
||||
return Err(Error::InsufficientFunds);
|
||||
}
|
||||
account.balance = account.balance + operator.escrow - escrow;
|
||||
operator.escrow = escrow;
|
||||
account.balance = account.balance + operator.escrow - req.escrow;
|
||||
operator.escrow = req.escrow;
|
||||
}
|
||||
operator.email = req.email;
|
||||
self.operators.insert(req.pubkey, operator);
|
||||
@ -860,7 +859,7 @@ impl BrainData {
|
||||
.iter()
|
||||
.map(|op| grpc::ListOperatorsResp {
|
||||
pubkey: op.key().to_string(),
|
||||
escrow: op.escrow / 1_000_000_000,
|
||||
escrow: op.escrow,
|
||||
email: op.email.clone(),
|
||||
app_nodes: 0,
|
||||
vm_nodes: op.vm_nodes.len() as u64,
|
||||
|
Loading…
Reference in New Issue
Block a user