aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/geth/js.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/geth/js.go')
-rw-r--r--cmd/geth/js.go18
1 files changed, 13 insertions, 5 deletions
diff --git a/cmd/geth/js.go b/cmd/geth/js.go
index 0061f20cf..6e5a6f1c7 100644
--- a/cmd/geth/js.go
+++ b/cmd/geth/js.go
@@ -25,7 +25,8 @@ import (
"strings"
"github.com/ethereum/go-ethereum/cmd/utils"
- "github.com/ethereum/go-ethereum/core/types"
+ "github.com/ethereum/go-ethereum/common/docserver"
+ "github.com/ethereum/go-ethereum/common/natspec"
"github.com/ethereum/go-ethereum/eth"
re "github.com/ethereum/go-ethereum/jsre"
"github.com/ethereum/go-ethereum/rpc"
@@ -139,10 +140,17 @@ var net = web3.net;
js.re.Eval(globalRegistrar + "registrar = new GlobalRegistrar(\"" + globalRegistrarAddr + "\");")
}
-func (self *jsre) ConfirmTransaction(tx *types.Transaction) bool {
- p := fmt.Sprintf("Confirm Transaction %v\n[y/n] ", tx)
- answer, _ := self.Prompt(p)
- return strings.HasPrefix(strings.Trim(answer, " "), "y")
+var ds, _ = docserver.New(utils.JSpathFlag.String())
+
+func (self *jsre) ConfirmTransaction(tx string) bool {
+ if self.ethereum.NatSpec {
+ notice := natspec.GetNotice(self.xeth, tx, ds)
+ fmt.Println(notice)
+ answer, _ := self.Prompt("Confirm Transaction\n[y/n] ")
+ return strings.HasPrefix(strings.Trim(answer, " "), "y")
+ } else {
+ return true
+ }
}
func (self *jsre) UnlockAccount(addr []byte) bool {