diff options
author | obscuren <geffobscura@gmail.com> | 2015-06-15 18:16:29 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-06-15 18:16:29 +0800 |
commit | 21fa29111b3cd12e3748fcb6310e6a18c5562f17 (patch) | |
tree | 511aef50b3d788a0ee109d1ec255d35153f8b3ff /common/types.go | |
parent | 6d817e16c1c17f7cad4a34fa91457e21f63f2de4 (diff) | |
download | go-tangerine-21fa29111b3cd12e3748fcb6310e6a18c5562f17.tar go-tangerine-21fa29111b3cd12e3748fcb6310e6a18c5562f17.tar.gz go-tangerine-21fa29111b3cd12e3748fcb6310e6a18c5562f17.tar.bz2 go-tangerine-21fa29111b3cd12e3748fcb6310e6a18c5562f17.tar.lz go-tangerine-21fa29111b3cd12e3748fcb6310e6a18c5562f17.tar.xz go-tangerine-21fa29111b3cd12e3748fcb6310e6a18c5562f17.tar.zst go-tangerine-21fa29111b3cd12e3748fcb6310e6a18c5562f17.zip |
core: reduce max allowed queued txs per address
Transactions in the queue are now capped to a maximum of 200
transactions. This number is completely arbitrary.
Diffstat (limited to 'common/types.go')
-rw-r--r-- | common/types.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/common/types.go b/common/types.go index 183d48fb3..d05c21eec 100644 --- a/common/types.go +++ b/common/types.go @@ -1,6 +1,7 @@ package common import ( + "fmt" "math/big" "math/rand" "reflect" @@ -95,3 +96,13 @@ func (a *Address) Set(other Address) { a[i] = v } } + +// PP Pretty Prints a byte slice in the following format: +// hex(value[:4])...(hex[len(value)-4:]) +func PP(value []byte) string { + if len(value) <= 8 { + return Bytes2Hex(value) + } + + return fmt.Sprintf("%x...%x", value[:4], value[len(value)-4]) +} |