Check enough funds on sender on TxProc &TxSel

- TxSelector
	- Add check enough funds on sender at TxSelector and don't
include the tx in the selection
- TxProcessor
	- Add checks that the balance when substracted the
amount/amount+fee never goes below 0

fix #502
This commit is contained in:
arnaucube
2021-01-26 15:42:38 +01:00
parent 30973aa292
commit bffc0d08ae
4 changed files with 162 additions and 8 deletions

View File

@@ -408,9 +408,9 @@ func TestSyncGeneral(t *testing.T) {
ForceExit(1) B: 80
ForceTransfer(1) A-D: 100
Transfer(1) C-A: 100 (200)
Exit(1) C: 50 (200)
Exit(1) D: 30 (200)
Transfer(1) C-A: 100 (126)
Exit(1) C: 50 (100)
Exit(1) D: 30 (100)
> batchL1 // forge L1UserTxs{nil}, freeze defined L1UserTxs{3}
> batchL1 // forge L1UserTxs{3}, freeze defined L1UserTxs{nil}