git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit 07abd8f821130e425de30cfb326a51dc64c4bf91

Kernel: check if sender exists

Alex Beregszaszi committed on 8/23/2016, 12:27:46 AM
Parent: 1a2a7cd98d2edb747a07a96b71f6315497059c94

Files changed

index.jschanged
index.jsView
@@ -129,8 +129,11 @@
129129 //
130130
131131 // look up sender
132132 let fromAccount = this.environment.state.get(new Uint8Array(tx.form).toString())
133+ if (!fromAccount) {
134+ throw new Error('Sender account not found')
135+ }
133136
134137 // deduct gasLimit * gasPrice from sender
135138 if (fromAccount.balance < (tx.gasLimit * tx.gasPrice)) {
136139 throw new Error('Insufficient account balance')

Built with git-ssb-web