mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 06:36:43 +00:00
all: not add or subtract one when compare integers
This commit is contained in:
parent
b62756d1a3
commit
dd18516601
3 changed files with 3 additions and 3 deletions
|
|
@ -151,7 +151,7 @@ func parseFilters(args []string) ([]nodeFilter, error) {
|
|||
if !ok {
|
||||
return nil, fmt.Errorf("invalid filter %q", args[0])
|
||||
}
|
||||
if len(args)-1 < fc.narg {
|
||||
if len(args) <= fc.narg {
|
||||
return nil, fmt.Errorf("filter %q wants %d arguments, have %d", args[0], fc.narg, len(args)-1)
|
||||
}
|
||||
filter, err := fc.fn(args[1 : 1+fc.narg])
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ func (f *chainFreezer) freeze(db ethdb.KeyValueStore) {
|
|||
first = frozen // the first block to freeze
|
||||
last = threshold // the last block to freeze
|
||||
)
|
||||
if last-first+1 > freezerBatchLimit {
|
||||
if last-first >= freezerBatchLimit {
|
||||
last = freezerBatchLimit + first - 1
|
||||
}
|
||||
ancients, err := f.freezeRange(nfdb, first, last)
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ const (
|
|||
// ipcListen will create a Unix socket on the given endpoint.
|
||||
func ipcListen(endpoint string) (net.Listener, error) {
|
||||
// account for null-terminator too
|
||||
if len(endpoint)+1 > maxPathSize {
|
||||
if len(endpoint) >= maxPathSize {
|
||||
log.Warn(fmt.Sprintf("The ipc endpoint is longer than %d characters. ", maxPathSize-1),
|
||||
"endpoint", endpoint)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue