From 21fa29111b3cd12e3748fcb6310e6a18c5562f17 Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 15 Jun 2015 12:16:29 +0200 Subject: 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. --- common/types.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'common/types.go') 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]) +} -- cgit v1.2.3