Commit aa0ef819 authored by Jared Pereira's avatar Jared Pereira

catch rejected transaction error

parent 0477bc77
......@@ -167,10 +167,16 @@ function parseCommand(cmd) {
const address = cmd[2] || '0x0'
try {
web3.eth.sendTransaction({from:web3.eth.accounts[0], to: address, value: web3.toWei(amount, 'ether')}, function(txreceipt){
var message = "/send: you sent " + amount + " ether to " + address
pushMessage({text: message, class:'notification'})
return;
web3.eth.sendTransaction({from:web3.eth.accounts[0], to: address, value: web3.toWei(amount, 'ether')}, function(err, txreceipt){
if(err){
console.log(err)
}
else {
console.log(txreceipt)
var message = "/send: you sent " + amount + " ether to " + address
pushMessage({text: message, class:'notification'})
return;
}
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment