Browse Source

Severely important fix to disable negative amounts on transactions.

Allexit 3 years ago
parent
commit
0e08502076
2 changed files with 5 additions and 2 deletions
  1. 3
    1
      README.md
  2. 2
    1
      src/com/saltosion/neptulon/BankManager.java

+ 3
- 1
README.md View File

@@ -96,7 +96,8 @@ Here is listed examples for all the required properties files, and explained wha
96 96
   "currency-symbol": "€ / Euro / Something",
97 97
   "encrypt-key": "FD7EFACC2336E5EF",
98 98
   "bid-length": 5,
99
-  "max-connections": -1
99
+  "max-connections": -1,
100
+  "transacion-id-length": 5
100 101
 }
101 102
 ```
102 103
 
@@ -117,6 +118,7 @@ Here is listed examples for all the required properties files, and explained wha
117 118
 - `encrypt-key` is a key used for encryption of passwords. This should differ for every user, and should be different for server- and clientside.
118 119
 - `bid-length` is the length of Client's BID's (eg. BID-7F40B is `5`). This only applies to BID's created AFTER the change.
119 120
 - `max-connections` is the maximum number of connections possible at onece. `-1` means *no limit*.
121
+- `transaction-id-length` is the length of transaction ID's.
120 122
 
121 123
 ## License
122 124
 This software is licensed under GNU GPLv3 license. All rights reserved.

+ 2
- 1
src/com/saltosion/neptulon/BankManager.java View File

@@ -91,7 +91,8 @@ public class BankManager {
91 91
 				new Transaction(properties.getTransactionIDLength(), 
92 92
 						transactionPackage.BIDfrom, transactionPackage.BIDto, 
93 93
 						transactionPackage.amount, "");
94
-		if (!verifyBID(transaction.bidFrom) || !verifyBID(transaction.bidTo)) {
94
+		if (!verifyBID(transaction.bidFrom) || !verifyBID(transaction.bidTo)
95
+                        || transaction.amount <= 0) {
95 96
 			return Problem.TRANSACTION_FAILED;
96 97
 		}
97 98
 		transactions.add(transaction);