aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-02-23 22:43:41 +0800
committerobscuren <geffobscura@gmail.com>2015-02-23 22:43:41 +0800
commitb2a225a52e45315f3ec90e11707fefa6059d13f5 (patch)
tree7019227fc4af5e39f88bcc58ddc455826df8d569 /cmd
parent20aa6dde067a0c8d28fdafd43e41f996f014e8b0 (diff)
downloaddexon-b2a225a52e45315f3ec90e11707fefa6059d13f5.tar.gz
dexon-b2a225a52e45315f3ec90e11707fefa6059d13f5.tar.zst
dexon-b2a225a52e45315f3ec90e11707fefa6059d13f5.zip
Properly uninstall filters. Mining issue fixed #closes #365
* Added an additional tx state which is used to get the current nonce * Refresh transient state each time a new canonical block is found * Properly uninstall filters. Fixes a possible crash in RPC
Diffstat (limited to 'cmd')
-rw-r--r--cmd/mist/assets/examples/coin.html24
1 files changed, 18 insertions, 6 deletions
diff --git a/cmd/mist/assets/examples/coin.html b/cmd/mist/assets/examples/coin.html
index 18a6811d7..509a9aeeb 100644
--- a/cmd/mist/assets/examples/coin.html
+++ b/cmd/mist/assets/examples/coin.html
@@ -19,6 +19,7 @@
<span>Amount:</span>
<input type="text" id="amount" style="width:200px">
<button onclick="transact()">Send</button>
+ <span id="message"></span>
</div>
<hr>
@@ -95,17 +96,28 @@
}
function transact() {
- var to = document.querySelector("#address").value;
- if( to.length == 0 ) {
+ var to = document.querySelector("#address");
+ if( to.value.length == 0 ) {
to = "0x4205b06c2cfa0e30359edcab94543266cb6fa1d3";
} else {
- to = "0x"+to;
+ if (to.value.substr(0,2) != "0x")
+ to.value = "0x"+to.value;
}
- var value = parseInt( document.querySelector("#amount").value );
- console.log("transact: ", to, " => ", value)
+ var value = document.querySelector("#amount");
+ var amount = parseInt( value.value );
+ console.log("transact: ", to.value, " => ", amount)
- contract.send( to, value );
+ contract.send( to.value, amount );
+
+ to.value = "";
+ value.value = "";
+
+ var message = document.querySelector("#message")
+ message.innerHTML = "Submitted";
+ setTimeout(function() {
+ message.innerHTML = "";
+ }, 1000);
}
refresh();