File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
bittensor/core/extrinsics Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,13 @@ async def add_stake_extrinsic(
8989 subtensor .get_existential_deposit (block_hash = block_hash ),
9090 )
9191
92+ # Leave existential balance to keep key alive.
93+ if old_balance <= existential_deposit :
94+ return ExtrinsicResponse (
95+ False ,
96+ f"Balance ({ old_balance } ) is not enough to cover existential deposit `{ existential_deposit } `." ,
97+ ).with_log ()
98+
9299 # Leave existential balance to keep key alive.
93100 if amount > old_balance - existential_deposit :
94101 # If we are staking all, we need to leave at least the existential deposit.
Original file line number Diff line number Diff line change @@ -86,6 +86,13 @@ def add_stake_extrinsic(
8686 )
8787 existential_deposit = subtensor .get_existential_deposit (block = block )
8888
89+ # Leave existential balance to keep key alive.
90+ if old_balance <= existential_deposit :
91+ return ExtrinsicResponse (
92+ False ,
93+ f"Balance ({ old_balance } ) is not enough to cover existential deposit `{ existential_deposit } `." ,
94+ ).with_log ()
95+
8996 # Leave existential balance to keep key alive.
9097 if amount > old_balance - existential_deposit :
9198 # If we are staking all, we need to leave at least the existential deposit.
You can’t perform that action at this time.
0 commit comments