aboutsummaryrefslogtreecommitdiffstats
path: root/utils/cmd.go
diff options
context:
space:
mode:
Diffstat (limited to 'utils/cmd.go')
-rw-r--r--utils/cmd.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/utils/cmd.go b/utils/cmd.go
index d34348ad8..58e3eed1e 100644
--- a/utils/cmd.go
+++ b/utils/cmd.go
@@ -8,6 +8,7 @@ import (
"os/signal"
"path"
"path/filepath"
+ "regexp"
"runtime"
"time"
@@ -267,6 +268,19 @@ func StartMining(ethereum *eth.Ethereum) bool {
return false
}
+func FormatTransactionData(data string) []byte {
+ d := ethutil.StringToByteFunc(data, func(s string) (ret []byte) {
+ slice := regexp.MustCompile("\\n|\\s").Split(s, 1000000000)
+ for _, dataItem := range slice {
+ d := ethutil.FormatData(dataItem)
+ ret = append(ret, d...)
+ }
+ return
+ })
+
+ return d
+}
+
func StopMining(ethereum *eth.Ethereum) bool {
if ethereum.Mining && miner != nil {
miner.Stop()