We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c3e9e93 commit a99b906Copy full SHA for a99b906
1 file changed
validations/src/validations.rs
@@ -1520,7 +1520,9 @@ pub fn validate_unstake_transaction<'a>(
1520
// Introduced in V2_1:
1521
// Apply a protocol-level "rule of convenience", where an amount to unstake of u64::MAX actually
1522
// means "unstake all my stake".
1523
- if protocol_version >= ProtocolVersion::V2_1 && amount_to_unstake == u64::MAX {
+ // Please take note that this validation sctrictly needs to take place before checking whether
1524
+ // the "remainder" amount meets the minimum stake. Otherwise, we would never reach this block.
1525
+ if protocol_version >= ProtocolVersion::V2_1 && amount_to_unstake == 0 {
1526
amount_to_unstake = staked_amount;
1527
}
1528
0 commit comments