code: func (pool *TxPool) GetNonce(ctx context.Context, addr common.Address) (uint64, error) {
  	state := pool.currentState(ctx)
  	nonce := state.GetNonce(addr)
  	if state.Error() != nil {
  		return 0, state.Error()
  	}
  	sn, ok := pool.nonce[addr]
  	if ok && sn > nonce {
  		nonce = sn
  	}
  	if !ok || sn < nonce {
  		pool.nonce[addr] = nonce
  	}
  	return nonce, nil
  }
docs: // GetNonce returns the "pending" nonce of a given address. It always queries
  // the nonce belonging to the latest header too in order to detect if another
  // client using the same key sent a transaction.