diff options
author | obscuren <geffobscura@gmail.com> | 2014-08-15 19:16:07 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-08-15 19:16:07 +0800 |
commit | a6c4543c575b52b943ff54f74c9d650d73175fe0 (patch) | |
tree | 23473e3076be6b394db680a5149cb8006f00a9db /utils | |
parent | c362172567e7bd499ea0d0bcf84c54a9b7788614 (diff) | |
download | dexon-a6c4543c575b52b943ff54f74c9d650d73175fe0.tar.gz dexon-a6c4543c575b52b943ff54f74c9d650d73175fe0.tar.zst dexon-a6c4543c575b52b943ff54f74c9d650d73175fe0.zip |
Moving over to ethpipe
Diffstat (limited to 'utils')
-rw-r--r-- | utils/cmd.go | 14 |
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() |