diff options
author | obscuren <geffobscura@gmail.com> | 2014-09-15 21:42:12 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-09-15 21:42:12 +0800 |
commit | 33a0dec8a157b9687ca6038f4deb011f3f1f7bdc (patch) | |
tree | 197b792e06dc3952df93957a39fdf6e44582ac96 /ethutil/bytes.go | |
parent | 2f614900e82036e3e8f6f6a714efc43e09aca830 (diff) | |
download | dexon-33a0dec8a157b9687ca6038f4deb011f3f1f7bdc.tar dexon-33a0dec8a157b9687ca6038f4deb011f3f1f7bdc.tar.gz dexon-33a0dec8a157b9687ca6038f4deb011f3f1f7bdc.tar.bz2 dexon-33a0dec8a157b9687ca6038f4deb011f3f1f7bdc.tar.lz dexon-33a0dec8a157b9687ca6038f4deb011f3f1f7bdc.tar.xz dexon-33a0dec8a157b9687ca6038f4deb011f3f1f7bdc.tar.zst dexon-33a0dec8a157b9687ca6038f4deb011f3f1f7bdc.zip |
Improved catching up and refactored
Diffstat (limited to 'ethutil/bytes.go')
-rw-r--r-- | ethutil/bytes.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ethutil/bytes.go b/ethutil/bytes.go index e38f89454..f151d16ee 100644 --- a/ethutil/bytes.go +++ b/ethutil/bytes.go @@ -9,6 +9,22 @@ import ( "strings" ) +type Bytes []byte + +func (self Bytes) String() string { + return string(self) +} + +func DeleteFromByteSlice(s [][]byte, hash []byte) [][]byte { + for i, h := range s { + if bytes.Compare(h, hash) == 0 { + return append(s[:i], s[i+1:]...) + } + } + + return s +} + // Number to bytes // // Returns the number in bytes with the specified base |