Commit 07abd8f821130e425de30cfb326a51dc64c4bf91
Kernel: check if sender exists
Alex Beregszaszi committed on 8/23/2016, 12:27:46 AMParent: 1a2a7cd98d2edb747a07a96b71f6315497059c94
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -129,8 +129,11 @@ | ||
129 | 129 | // |
130 | 130 | |
131 | 131 | // look up sender |
132 | 132 | let fromAccount = this.environment.state.get(new Uint8Array(tx.form).toString()) |
133 | + if (!fromAccount) { | |
134 | + throw new Error('Sender account not found') | |
135 | + } | |
133 | 136 | |
134 | 137 | // deduct gasLimit * gasPrice from sender |
135 | 138 | if (fromAccount.balance < (tx.gasLimit * tx.gasPrice)) { |
136 | 139 | throw new Error('Insufficient account balance') |
Built with git-ssb-web